summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-07-25 07:23:58 +0200
committerDavid Lawrence <dlawrence@mozilla.com>2011-07-25 07:23:58 +0200
commit7ddff2f30647abe482a19a9fd38a44383c5b0242 (patch)
tree6a24e91bd2e1a81a18b9b4e145769be6f24773bc /Bugzilla/Template.pm
parent2686b79f087eda7d917aade30e12d18bf8d16c12 (diff)
downloadbugzilla-7ddff2f30647abe482a19a9fd38a44383c5b0242.tar.gz
bugzilla-7ddff2f30647abe482a19a9fd38a44383c5b0242.tar.xz
Bug 652663 - When using bug_format_comment hook some replacements can happen more than once causing broken links
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 726ca1ca3..d8822272f 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -264,8 +264,10 @@ sub quoteUrls {
~get_bug_link($1, $1)
~egmx;
- # Now remove the encoding hacks
- $text =~ s/\0\0(\d+)\0\0/$things[$1]/eg;
+ # Now remove the encoding hacks in reverse order
+ for (my $i = $#things; $i >= 0; $i--) {
+ $text =~ s/\0\0($i)\0\0/$things[$i]/eg;
+ }
$text =~ s/$chr1\0/\0/g;
return $text;