]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 73330: Remove extra newlines in bugmail
authormkanat%bugzilla.org <>
Wed, 19 Aug 2009 04:46:30 +0000 (04:46 +0000)
committermkanat%bugzilla.org <>
Wed, 19 Aug 2009 04:46:30 +0000 (04:46 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla/BugMail.pm
template/en/default/email/newchangedmail.txt.tmpl

index 9a1b2a8a258adcf37f6c68eaa44de47a58e90d7c..ec4bf30dae58346ba5d01e9522aa5af784088560 100644 (file)
@@ -352,7 +352,7 @@ sub Send {
 
         if ($deptext) {
             my $diffpart = {};
-            $diffpart->{'text'} = "\n" . trim("\n\n" . $deptext);
+            $diffpart->{'text'} = "\n" . trim($deptext);
             push(@diffparts, $diffpart);
         }
     }
@@ -595,6 +595,8 @@ sub sendMail {
     }
 
     my $diffs = $difftext;
+    # Remove extra newlines.
+    $diffs =~ s/^\n+//s; $diffs =~ s/\n+$//s;
     if ($isnew) {
         my $head = "";
         foreach my $f (@headerlist) {
index 494c12060f0ee4f58870513ddb8deb2ce3069d0a..b90c15b1d2ada28f4c4315d2ec26647b14c5085e 100644 (file)
@@ -41,8 +41,10 @@ X-Bugzilla-Changed-Fields: [% changedfields %]
 [%+ threadingmarker %]
 
 [%+ urlbase %]show_bug.cgi?id=[% bugid %]
+[%- IF diffs %]
 
 [%+ diffs %]
+[% END -%]
 [% FOREACH comment = new_comments %]
 
 --- Comment #[% comment.count %] from [% comment.author.identity %] [%+ comment.time FILTER time %] ---