Переглянути джерело

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

sbingner 25 роки тому
батько
коміт
947ce83f87
1 змінених файлів з 3 додано та 1 видалено
  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;
 }