newline characters at the end, depending on the operating system of
the browser that submitted the text.
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;
}
$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;