diff --git a/mozilla/webtools/bugzilla/attachment.cgi b/mozilla/webtools/bugzilla/attachment.cgi index 9308b1d7378..8fcac0b8859 100755 --- a/mozilla/webtools/bugzilla/attachment.cgi +++ b/mozilla/webtools/bugzilla/attachment.cgi @@ -478,17 +478,34 @@ sub update # add the comment to the bug. if ( $::FORM{'comment'} ) { + use Text::Wrap; + $Text::Wrap::columns = 80; + $Text::Wrap::huge = 'wrap'; + # Append a string to the comment to let users know that the comment came from # the "edit attachment" screen. my $comment = qq|(From update of attachment $::FORM{'id'})\n| . $::FORM{'comment'}; + my $wrappedcomment = ""; + foreach my $line (split(/\r\n|\r|\n/, $comment)) + { + if ( $line =~ /^>/ ) + { + $wrappedcomment .= $line . "\n"; + } + else + { + $wrappedcomment .= wrap('', '', $line) . "\n"; + } + } + # Get the user's login name since the AppendComment function needs it. my $who = DBID_to_name($::userid); # Mention $::userid again so Perl doesn't give me a warning about it. my $neverused = $::userid; # Append the comment to the list of comments in the database. - AppendComment($bugid, $who, $comment); + AppendComment($bugid, $who, $wrappedcomment); } diff --git a/mozilla/webtools/bugzilla/template/default/attachment/edit.atml b/mozilla/webtools/bugzilla/template/default/attachment/edit.atml index e1fc3e0353a..5981a692ff7 100755 --- a/mozilla/webtools/bugzilla/template/default/attachment/edit.atml +++ b/mozilla/webtools/bugzilla/template/default/attachment/edit.atml @@ -26,7 +26,7 @@ Description:
-
+
MIME Type:

@@ -44,7 +44,7 @@
Comment (on the bug):
-
+