aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:43:53 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:43:53 +0200
commit9c9eac99fd7008f2b711a33736f21e5103791a04 (patch)
treeccb23e98e0a07c8282612b651f011d64658caf33 /Bugzilla/Template.pm
parentfcd445919eab36a4b1b1c415e9c20fabb2ec0ac0 (diff)
downloadbugs-9c9eac99fd7008f2b711a33736f21e5103791a04.tar
bugs-9c9eac99fd7008f2b711a33736f21e5103791a04.tar.gz
bugs-9c9eac99fd7008f2b711a33736f21e5103791a04.tar.bz2
bugs-9c9eac99fd7008f2b711a33736f21e5103791a04.tar.xz
bugs-9c9eac99fd7008f2b711a33736f21e5103791a04.zip
Bug 1143871: Correctly preload bug data when viewing a bug
r=dkl a=sgreen
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 836bbc7ac..3fd71236e 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -148,10 +148,9 @@ sub get_format {
# If you want to modify this routine, read the comments carefully
sub quoteUrls {
- my ($text, $bug, $comment, $user, $bug_link_func) = @_;
+ my ($text, $bug, $comment, $user) = @_;
return $text unless $text;
$user ||= Bugzilla->user;
- $bug_link_func ||= \&get_bug_link;
# We use /g for speed, but uris can have other things inside them
# (http://foo/bug#3 for example). Filtering that out filters valid
@@ -205,7 +204,7 @@ sub quoteUrls {
map { qr/$_/ } grep($_, Bugzilla->params->{'urlbase'},
Bugzilla->params->{'sslbase'})) . ')';
$text =~ s~\b(${urlbase_re}\Qshow_bug.cgi?id=\E([0-9]+)(\#c([0-9]+))?)\b
- ~($things[$count++] = $bug_link_func->($3, $1, { comment_num => $5, user => $user })) &&
+ ~($things[$count++] = get_bug_link($3, $1, { comment_num => $5, user => $user })) &&
("\x{FDD2}" . ($count-1) . "\x{FDD3}")
~egox;
@@ -252,7 +251,7 @@ sub quoteUrls {
$text =~ s~\b($bug_re(?:$s*,?$s*$comment_re)?|$comment_re)
~ # We have several choices. $1 here is the link, and $2-4 are set
# depending on which part matched
- (defined($2) ? $bug_link_func->($2, $1, { comment_num => $3, user => $user }) :
+ (defined($2) ? get_bug_link($2, $1, { comment_num => $3, user => $user }) :
"<a href=\"$current_bugurl#c$4\">$1</a>")
~egx;
@@ -266,7 +265,7 @@ sub quoteUrls {
$text =~ s{($bugs_re)}{
my $match = $1;
- $match =~ s/((?:#$s*)?(\d+))/$bug_link_func->($2, $1);/eg;
+ $match =~ s/((?:#$s*)?(\d+))/get_bug_link($2, $1);/eg;
$match;
}eg;
@@ -286,7 +285,7 @@ sub quoteUrls {
$text =~ s~(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )
(\d+)
(?=\ \*\*\*\Z)
- ~$bug_link_func->($1, $1, { user => $user })
+ ~get_bug_link($1, $1, { user => $user })
~egmx;
# Now remove the encoding hacks in reverse order
@@ -300,7 +299,6 @@ sub quoteUrls {
# Creates a link to an attachment, including its title.
sub get_attachment_link {
my ($attachid, $link_text, $user) = @_;
- my $dbh = Bugzilla->dbh;
$user ||= Bugzilla->user;
my $attachment = new Bugzilla::Attachment({ id => $attachid, cache => 1 });
@@ -351,7 +349,6 @@ sub get_bug_link {
my ($bug, $link_text, $options) = @_;
$options ||= {};
$options->{user} ||= Bugzilla->user;
- my $dbh = Bugzilla->dbh;
if (defined $bug && $bug ne '') {
if (!blessed($bug)) {