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
This commit is contained in:
fiddlosopher 2008-10-16 01:00:51 +00:00
parent d0fe8dcae0
commit f08ebf5a9b

View file

@ -136,16 +136,16 @@ unsanitaryAttribute (attr, val, _) = do
-- | Returns @True@ if the specified URI is potentially a security risk. -- | Returns @True@ if the specified URI is potentially a security risk.
unsanitaryURI :: String -> Bool unsanitaryURI :: String -> Bool
unsanitaryURI u = unsanitaryURI u =
let safeURISchemes = [ "", "http", "https", "ftp", "mailto", "file", let safeURISchemes = [ "", "http:", "https:", "ftp:", "mailto:", "file:",
"telnet", "gopher", "aaa", "aaas", "acap", "cap", "cid", "telnet:", "gopher:", "aaa:", "aaas:", "acap:", "cap:", "cid:",
"crid", "dav", "dict", "dns", "fax", "go", "h323", "im", "crid:", "dav:", "dict:", "dns:", "fax:", "go:", "h323:", "im:",
"imap", "ldap", "mid", "news", "nfs", "nntp", "pop", "imap:", "ldap:", "mid:", "news:", "nfs:", "nntp:", "pop:",
"pres", "sip", "sips", "snmp", "tel", "urn", "wais", "pres:", "sip:", "sips:", "snmp:", "tel:", "urn:", "wais:",
"xmpp", "z39.50r", "z39.50s", "aim", "callto", "cvs", "xmpp:", "z39.50r:", "z39.50s:", "aim:", "callto:", "cvs:",
"ed2k", "feed", "fish", "gg", "irc", "ircs", "lastfm", "ed2k:", "feed:", "fish:", "gg:", "irc:", "ircs:", "lastfm:",
"ldaps", "magnet", "mms", "msnim", "notes", "rsync", "ldaps:", "magnet:", "mms:", "msnim:", "notes:", "rsync:",
"secondlife", "skype", "ssh", "sftp", "smb", "sms", "secondlife:", "skype:", "ssh:", "sftp:", "smb:", "sms:",
"snews", "webcal", "ymsgr"] "snews:", "webcal:", "ymsgr:"]
in case parseURIReference u of in case parseURIReference u of
Just p -> (map toLower $ uriScheme p) `notElem` safeURISchemes Just p -> (map toLower $ uriScheme p) `notElem` safeURISchemes
Nothing -> True Nothing -> True