aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-10-16 01:00:51 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-10-16 01:00:51 +0000
commitf08ebf5a9b944a34d5e38d823e0e19dbc2c7fe27 (patch)
treedb82edeb07db11e988849173a8376234ea9655f4
parentd0fe8dcae0c82e5a84c37f3e9ba400cdf06d0a9f (diff)
downloadpandoc-f08ebf5a9b944a34d5e38d823e0e19dbc2c7fe27.tar.gz
Added colons to protocols in unsanitaryURI in HTML reader.
Closes Issue #88. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1462 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Text/Pandoc/Readers/HTML.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Text/Pandoc/Readers/HTML.hs b/Text/Pandoc/Readers/HTML.hs
index a9025f0d2..10b7ad011 100644
--- a/Text/Pandoc/Readers/HTML.hs
+++ b/Text/Pandoc/Readers/HTML.hs
@@ -136,16 +136,16 @@ unsanitaryAttribute (attr, val, _) = do
-- | Returns @True@ if the specified URI is potentially a security risk.
unsanitaryURI :: String -> Bool
unsanitaryURI u =
- let safeURISchemes = [ "", "http", "https", "ftp", "mailto", "file",
- "telnet", "gopher", "aaa", "aaas", "acap", "cap", "cid",
- "crid", "dav", "dict", "dns", "fax", "go", "h323", "im",
- "imap", "ldap", "mid", "news", "nfs", "nntp", "pop",
- "pres", "sip", "sips", "snmp", "tel", "urn", "wais",
- "xmpp", "z39.50r", "z39.50s", "aim", "callto", "cvs",
- "ed2k", "feed", "fish", "gg", "irc", "ircs", "lastfm",
- "ldaps", "magnet", "mms", "msnim", "notes", "rsync",
- "secondlife", "skype", "ssh", "sftp", "smb", "sms",
- "snews", "webcal", "ymsgr"]
+ let safeURISchemes = [ "", "http:", "https:", "ftp:", "mailto:", "file:",
+ "telnet:", "gopher:", "aaa:", "aaas:", "acap:", "cap:", "cid:",
+ "crid:", "dav:", "dict:", "dns:", "fax:", "go:", "h323:", "im:",
+ "imap:", "ldap:", "mid:", "news:", "nfs:", "nntp:", "pop:",
+ "pres:", "sip:", "sips:", "snmp:", "tel:", "urn:", "wais:",
+ "xmpp:", "z39.50r:", "z39.50s:", "aim:", "callto:", "cvs:",
+ "ed2k:", "feed:", "fish:", "gg:", "irc:", "ircs:", "lastfm:",
+ "ldaps:", "magnet:", "mms:", "msnim:", "notes:", "rsync:",
+ "secondlife:", "skype:", "ssh:", "sftp:", "smb:", "sms:",
+ "snews:", "webcal:", "ymsgr:"]
in case parseURIReference u of
Just p -> (map toLower $ uriScheme p) `notElem` safeURISchemes
Nothing -> True