diff options
author | lpsolit%gmail.com <> | 2009-09-08 16:11:08 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-09-08 16:11:08 +0000 |
commit | d26ef3f6e793015f91ca0c9bc5dfda7c20d89835 (patch) | |
tree | e9fb5fadd1dcc23b10eef65b101a29bbcd957bc6 /Bugzilla/BugMail.pm | |
parent | Bug 515149: BugMail.pm uses urlbase for dependency notifications despite sslb... (diff) | |
download | bugzilla-d26ef3f6e793015f91ca0c9bc5dfda7c20d89835.tar.gz bugzilla-d26ef3f6e793015f91ca0c9bc5dfda7c20d89835.tar.bz2 bugzilla-d26ef3f6e793015f91ca0c9bc5dfda7c20d89835.zip |
Bug 509035: An empty e-mail gets sent to non-timetrackinggroup members if I change time tracking information - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r-- | Bugzilla/BugMail.pm | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index bea36e866..5bbbe723a 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -576,22 +576,11 @@ sub sendMail { $difftext .= $diff->{'text'}; } } - - if ($difftext eq "" && $newcomments eq "" && !$isnew) { + + if ($difftext eq "" && !scalar(@$newcomments) && !$isnew) { # Whoops, no differences! return 0; } - - # If an attachment was created, then add an URL. (Note: the 'g'lobal - # replace should work with comments with multiple attachments.) - - if ( $newcomments =~ /Created an attachment \(/ ) { - - my $showattachurlbase = - Bugzilla->params->{'urlbase'} . "attachment.cgi?id="; - - $newcomments =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2\)/g; - } my $diffs = $difftext; # Remove extra newlines. @@ -686,9 +675,15 @@ sub get_comments_by_bug { my $raw = 1; # Do not format comments which are not of type CMT_NORMAL. my $comments = Bugzilla::Bug::GetComments($id, "oldest_to_newest", $start, $end, $raw); + my $attach_base = correct_urlbase() . 'attachment.cgi?id='; foreach my $comment (@$comments) { $comment->{count} = $count++; + # If an attachment was created, then add an URL. (Note: the 'g'lobal + # replace should work with comments with multiple attachments.) + if ($comment->{body} =~ /Created an attachment \(/) { + $comment->{body} =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \($attach_base$2\)/g; + } } if (Bugzilla->params->{'insidergroup'}) { |