]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/CGI.pm
Change how maybelink links links (closes: #501757)
[debbugs.git] / Debbugs / CGI.pm
index cceeb36cdddf8df589536e2c24bf604be3c5a7b4..3cd4348c4d672ac0832a72c6fc644e5978ce50e3 100644 (file)
@@ -530,6 +530,11 @@ the split links with commas and spaces.
 
 sub maybelink {
     my ($links,$regex,$join) = @_;
+    if (not defined $regex and not defined $join) {
+        $links =~ s{((?:ftp|http|https)://[\S~-]+?/?)([\)\'\:\.\,]?(?:\s|\.<|$))}
+                   {q(<a href=\").html_escape($1).q(\">).html_escape($1).q(</a>).$2}geimo;
+        return $links;
+    }
     $join = ' ' if not defined $join;
     my @return;
     my @segments;