Commit d24a52b9 authored by zach%zachlipton.com's avatar zach%zachlipton.com

Fix for bug 102032: Fix tinderbox test errors and warnings. Patch to make…

Fix for bug 102032: Fix tinderbox test errors and warnings. Patch to make new_comment.cgi use strict and warnings and make tests run at 100%! Patch by Jake <jake@acutex.net>, r=justdave, no 2nd review needed.
parent efb81d81
...@@ -20,13 +20,17 @@ ...@@ -20,13 +20,17 @@
# #
# Contributor(s): Terry Weissman <terry@mozilla.org> # Contributor(s): Terry Weissman <terry@mozilla.org>
use strict;
my %FORM;
my $buffer = "";
if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; } if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; }
else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
# Split the name-value pairs # Split the name-value pairs
@pairs = split(/&/, $buffer); my @pairs = split(/&/, $buffer);
foreach $pair (@pairs) foreach my $pair (@pairs)
{ {
($name, $value) = split(/=/, $pair); my ($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /; $value =~ tr/+/ /;
$value =~ s/^(\s*)//s; $value =~ s/^(\s*)//s;
...@@ -34,7 +38,7 @@ foreach $pair (@pairs) ...@@ -34,7 +38,7 @@ foreach $pair (@pairs)
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value; $FORM{$name} = $value;
} }
$c=$FORM{"comment"}; my $c = $FORM{"comment"};
if ( (!defined $c) || ($c eq '') ) { if ( (!defined $c) || ($c eq '') ) {
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
print "<TITLE>Nothing on your mind?</TITLE>"; print "<TITLE>Nothing on your mind?</TITLE>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment