diff --git a/src/Templates/Error.hs b/src/Templates/Error.hs index 64d36d5..0963992 100644 --- a/src/Templates/Error.hs +++ b/src/Templates/Error.hs @@ -5,6 +5,7 @@ module Templates.Error (errorPage) where import qualified Data.Text.Lazy as TL import Text.RawString.QQ +import Text.HTML.SanitizeXSS errorPage :: TL.Text -> TL.Text errorPage msg = [r| @@ -17,7 +18,7 @@ errorPage msg = [r|
|] <> msg <> [r|
+|] <> (TL.fromStrict (sanitize (TL.toStrict msg))) <> [r|
viddl is free open source software and is powered by youtube-dl.
"
+ , out, err
+ , "'
"
+ ]))
+
+ _ -> pure (Left "Unable to spawn process for downloading")
diff --git a/viddl.cabal b/viddl.cabal
index 0e4b015..aeadcb8 100644
--- a/viddl.cabal
+++ b/viddl.cabal
@@ -30,6 +30,7 @@ library
, pureMD5
, utf8-string
, transformers
+ , xss-sanitize
hs-source-dirs: src
default-language: Haskell2010
@@ -52,5 +53,6 @@ executable viddl
, pureMD5
, utf8-string
, transformers
+ , xss-sanitize
hs-source-dirs: src
default-language: Haskell2010