From cfe328ecbdff3705b84d5a14c1a2122835c04997 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 10 Feb 2008 15:28:48 -0500 Subject: [PATCH] fix data:image handling --- IkiWiki/Plugin/htmlscrubber.pm | 7 +++---- t/htmlize.t | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 60ad17baf..c83ffb48d 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -29,16 +29,15 @@ sub scrubber { #{{{ "ldap", "mid", "news", "nfs", "nntp", "pop", "pres", "sip", "sips", "snmp", "tel", "urn", "wais", "xmpp", "z39.50r", "z39.50s", - # data is a special case. Allow data:text/, but - # disallow data:text/javascript and everything else. - qr/data:text\/(?:png|gif|jpeg)/, # Selected unofficial schemes "about", "aim", "callto", "cvs", "ed2k", "feed", "fish", "gg", "irc", "ircs", "lastfm", "ldaps", "magnet", "mms", "msnim", "notes", "rsync", "secondlife", "skype", "ssh", "sftp", "sms", "steam", "webcal", "ymsgr", ); - my $link=qr/^(?:$uri_schemes:|[^:]+$)/i; + # data is a special case. Allow data:image/*, but + # disallow data:text/javascript and everything else. + my $link=qr/^(?:$uri_schemes:|data:image\/|[^:]+$)/i; eval q{use HTML::Scrubber}; error($@) if $@; diff --git a/t/htmlize.t b/t/htmlize.t index 0be94ab6b..bbebdac63 100755 --- a/t/htmlize.t +++ b/t/htmlize.t @@ -46,11 +46,11 @@ ok(!gotcha(q{