You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2004/05/15 03:38:42 UTC
svn commit: rev 10666 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Author: jm
Date: Fri May 14 18:38:42 2004
New Revision: 10666
Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
Log:
bug 3368: URL parsing assumed mailto if scheme was missing in a href. Fixed
Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Fri May 14 18:38:42 2004
@@ -781,6 +781,14 @@
# Make a copy so we don't trash the original
my $nuri = $uri;
+ if ($nuri !~ /^[a-z0-9_-]+:/i) { # no scheme?
+ $nuri = "http://".$nuri; # assume HTTP, as a web browser would
+ # TODO: should we be sensitive to the type of attribute ("href", etc.)
+ # this appears in? IMO, no, since as far as I can see it doesn't
+ # make any difference; most browsers/MUAs will assume a default
+ # of HTTP.
+ }
+
# http:www.foo.biz -> http://www.foo.biz
$nuri =~ s#^(https?:)/{0,2}#$1//#i;