From ca0361863e6e8f8328f068b9ef25b4d55a5f841b Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" <> Date: Thu, 22 Apr 1999 00:45:22 +0000 Subject: Fixed a bug where the long descriptions of bugs had a variety of newline characters at the end, depending on the operating system of the browser that submitted the text. --- globals.pl | 8 +++++++- post_bug.cgi | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/globals.pl b/globals.pl index d6e18d225..26539107b 100644 --- a/globals.pl +++ b/globals.pl @@ -78,7 +78,13 @@ sub FetchOneColumn { sub AppendComment { my ($bugid,$who,$comment) = (@_); - $comment =~ s/\r\n/\n/; # Get rid of windows-style line endings. + open(DEBUG, ">/tmp/debug"); + print DEBUG "A $comment"; + $comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings. + print DEBUG "B $comment"; + $comment =~ s/\r/\n/g; # Get rid of mac-style line endings. + print DEBUG "C $comment"; + close DEBUG; if ($comment =~ /^\s*$/) { # Nothin' but whitespace. return; } diff --git a/post_bug.cgi b/post_bug.cgi index 1cff52326..c0102fdbf 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -105,7 +105,12 @@ foreach my $field (@bug_fields) { $query .= SqlQuote($::FORM{$field}) . ",\n"; } -$query .= "now(), " . SqlQuote($::FORM{'comment'}) . " )\n"; +my $comment = $::FORM{'comment'}; +$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings. +$comment =~ s/\r/\n/g; # Get rid of mac-style line endings. +$comment = trim($comment); + +$query .= "now(), " . SqlQuote($comment) . " )\n"; my %ccids; -- cgit v1.2.3-24-g4f1b