diff options
author | stuebinm | 2021-12-21 13:42:28 +0100 |
---|---|---|
committer | stuebinm | 2021-12-21 13:42:28 +0100 |
commit | 5970aaec26b95b2023b5823a7af89645a11b04a4 (patch) | |
tree | e40e861b8a63b9d1022235570e7ba276f79c1a98 /lib/Paths.hs | |
parent | 3a9af9322c1348b03034b80fb11b5a22e3b811a2 (diff) |
disallow double courly braces
as per yesterday's discussion about extended scripting variables
Diffstat (limited to '')
-rw-r--r-- | lib/Paths.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Paths.hs b/lib/Paths.hs index d2861eb..b9b0d50 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -30,7 +30,7 @@ data PathResult = OkRelPath RelPath -- | horrible regex parsing for filepaths that is hopefully kinda safe parsePath :: Text -> PathResult parsePath text = - if | text =~ ("{{{.*}}}" :: Text) -> PathVarsDisallowed + if | T.isInfixOf "{{" text || T.isInfixOf "}}" text -> PathVarsDisallowed | rest =~ ("^([^/]*[^\\./]/)*[^/]*[^\\./]$" :: Text) -> OkRelPath (Path up path fragment) | "/_/" `isPrefixOf` text -> UnderscoreMapLink | "/@/" `isPrefixOf` text -> AtMapLink |