spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: rev 10666 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Date Sat, 15 May 2004 01:38:42 GMT
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;
 

Mime
View raw message