You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/10/02 21:40:21 UTC

svn commit: rev 51811 - in spamassassin/trunk: lib/Mail/SpamAssassin t

Author: felicity
Date: Sat Oct  2 12:40:21 2004
New Revision: 51811

Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
   spamassassin/trunk/t/uri.t
Log:
bug 3427: if a schemeless URI was found, we would add 'http://' to the front, which is very bad since it would do this for 'foo.gif', '#foo', etc.  Also, modify uri.t to give debug output upon failure.

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm	Sat Oct  2 12:40:21 2004
@@ -842,14 +842,6 @@
     # 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;
 

Modified: spamassassin/trunk/t/uri.t
==============================================================================
--- spamassassin/trunk/t/uri.t	(original)
+++ spamassassin/trunk/t/uri.t	Sat Oct  2 12:40:21 2004
@@ -98,9 +98,11 @@
   my @expect = sort { $a cmp $b } @{$expect};
 
   # output what we want/get for debugging
-  #warn ">> expect: @expect\n>> got: @input\n";
-
-  return array_cmp(\@input, \@expect);
+  my $res = array_cmp(\@input, \@expect);
+  if (!$res) {
+    warn ">> expect: [ @expect ]\n>> got: [ @input ]\n";
+  }
+  return $res;
 }
 
 # We should get the raw versions and a single "correct" version