From 5970aaec26b95b2023b5823a7af89645a11b04a4 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 21 Dec 2021 13:42:28 +0100 Subject: disallow double courly braces as per yesterday's discussion about extended scripting variables --- lib/Paths.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Paths.hs') 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 -- cgit v1.2.3