Ver Fonte

* Fix wrong recognizing of www URLs where "ewww" would be recognized as an
URL.

Morten Brix Pedersen há 22 anos atrás
pai
commit
52af27247e
2 ficheiros alterados com 3 adições e 1 exclusões
  1. 2 0
      docs/Changelog
  2. 1 1
      modules/Pisg/Common.pm

+ 2 - 0
docs/Changelog

@@ -1,6 +1,8 @@
 pisg (x.xx)
    * Revert most of the performance improvement changes, they caused bugs.
    * Really fix topics with the mbot format.
+   * Fix wrong recognizing of www URLs where "ewww" would be recognized as an
+     URL.
 
 pisg (0.53) - Tue Mar, 23rd 2004
    * Several noticeable performance improvements (thanks, Hanno Hecker)

+ 1 - 1
modules/Pisg/Common.pm

@@ -146,7 +146,7 @@ sub match_urls
     my $str = shift;
 
     # Interpret 'www.' as 'http://www.'
-    $str =~ s/(http:\/\/)?www\./http:\/\/www\./igo;
+    $str =~ s/\b(http:\/\/)?www\./http:\/\/www\./igo;
 
     my @urls;
     while ($str =~ s/(http|https|ftp|telnet|news)(:\/\/[-a-zA-Z0-9_\/~\@:]+\.[-a-zA-Z0-9.,_~=:&\@%?#\/+]+)//io) {