Browse Source

strip trailing /'s off of URLs so we don't count http://name/ and http://name as
2 separate URLs

sbingner 25 năm trước cách đây
mục cha
commit
947ce83f87
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      modules/Pisg/Common.pm

+ 3 - 1
modules/Pisg/Common.pm

@@ -110,7 +110,9 @@ sub match_url
     my ($str) = @_;
 
     if ($str =~ /(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_]+\.[-a-zA-Z0-9.,_~=:;&@%?#\/+]+)/) {
-        return "$1$2";
+        my $url = "$1$2";
+        $url =~ s/\/$//;
+        return $url;
     }
     return undef;
 }