# as prefix. In addition it replaces a ' ' by a '_'.
css_class_quote => \&Bugzilla::Util::css_class_quote ,
- quoteUrls => \&::quoteUrls ,
+ quoteUrls => [ sub {
+ my ($context, $bug) = @_;
+ return sub {
+ my $text = shift;
+ return &::quoteUrls($text, $bug);
+ };
+ },
+ 1
+ ],
bug_link => [ sub {
my ($context, $bug) = @_;
# If you want to modify this routine, read the comments carefully
sub quoteUrls {
- my ($text) = (@_);
+ my ($text, $curr_bugid) = (@_);
return $text unless $text;
# We use /g for speed, but uris can have other things inside them
("\0\0" . ($count-1) . "\0\0")
~egmxi;
+ # Current bug ID this comment belongs to
+ my $current_bugurl = $curr_bugid ? "show_bug.cgi?id=$curr_bugid" : "";
+
# This handles bug a, comment b type stuff. Because we're using /g
# we have to do this in one pattern, and so this is semi-messy.
# Also, we can't use $bug_re?$comment_re? because that will match the
~ # We have several choices. $1 here is the link, and $2-4 are set
# depending on which part matched
(defined($2) ? GetBugLink($2,$1,$3) :
- "<a href=\"#c$4\">$1</a>")
+ "<a href=\"$current_bugurl#c$4\">$1</a>")
~egox;
# Duplicate markers
[% wrapped_comment = comment.body FILTER wrap_comment %]
[% END %]
<pre[% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]>
- [%- wrapped_comment FILTER quoteUrls -%]
+ [%- wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
</pre>
</div>
[% END %]