]> git.donarmstrong.com Git - debbugs.git/commitdiff
Properly html_escape un-processed parts in maybelink (closes: #530506)
authorDon Armstrong <don@donarmstrong.com>
Mon, 25 May 2009 19:54:23 +0000 (12:54 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 25 May 2009 19:54:23 +0000 (12:54 -0700)
Debbugs/CGI.pm
debian/changelog

index d305aed7e2724261fa1c3723846bc378e0351a02..9d96ed9e287f2608ea638d760ea4b54473b61430 100644 (file)
@@ -536,8 +536,8 @@ 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;
+        $links =~ s{(.*?)((?:(?:ftp|http|https)://[\S~-]+?/?)?)([\)\'\:\.\,]?(?:\s|\.<|$))}
+                   {html_escape($1).(length $2?q(<a href=").html_escape($2).q(">).html_escape($2).q(</a>):'').html_escape($3)}geimo;
         return $links;
     }
     $join = ' ' if not defined $join;
index 93eaa055c7e2397abd0afb3f10665903d3569c2b..72f1383837f8425d56473730afcf167093e5c18a 100644 (file)
@@ -248,6 +248,7 @@ debbugs (2.4.2~exp0) UNRELEASED; urgency=low
   * Don't have reply/subscribe links for archived bugs (closes: #511864)
   * Fix issue with no-maintainer bugs assigned to multiple packages
     (closes: #528249)
+  * Properly html_escape un-processed parts in maybelink (closes: #530506)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100