diff --git a/lib/Paths.hs b/lib/Paths.hs
index d2861ebd9365c825cd21cbb34c772df583c82a1c..b9b0d50e275fc750058026d5a6cc8c424253286e 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
diff --git a/lib/Uris.hs b/lib/Uris.hs
index e2d9a5f1ee10b91f2dfa052781b1e9e3d690b64f..24ddd93c0f2dc83276aaddef0f671feebd88a2dc 100644
--- a/lib/Uris.hs
+++ b/lib/Uris.hs
@@ -18,6 +18,7 @@ import           Data.Either.Combinators (maybeToRight)
 import           Data.Map.Strict         (Map)
 import qualified Data.Map.Strict         as M
 import           Data.Text               (Text, pack)
+import qualified Data.Text as T
 import           GHC.Generics            (Generic)
 import           GHC.TypeLits            (KnownSymbol, symbolVal)
 import           Text.Regex.TDFA         ((=~))
@@ -66,7 +67,7 @@ data SubstError =
 applySubst :: KnownSymbol s
   => Proxy s -> SchemaSet -> Text -> Either SubstError Text
 applySubst s substs uri =  do
-  when (uri =~ "{{{.*}}}")
+  when (T.isInfixOf (pack "{{") uri || T.isInfixOf (pack "}}") uri)
    $ Left VarsDisallowed
   (schema, domain, rest) <- note NotALink $ parseUri uri