Procházet zdrojové kódy

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

sbingner před 25 roky
rodič
revize
947ce83f87
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      modules/Pisg/Common.pm

+ 3 - 1
modules/Pisg/Common.pm

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