summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzach%zachlipton.com <>2001-10-05 11:16:34 +0200
committerzach%zachlipton.com <>2001-10-05 11:16:34 +0200
commitd24a52b9245badb17016ed1b3daeeb9eb266f421 (patch)
tree9dd00108e8852e00eec9efb8e9012ca0008833fe
parentefb81d81465aba261a705d4eecd08fa26444ba53 (diff)
downloadbugzilla-d24a52b9245badb17016ed1b3daeeb9eb266f421.tar.gz
bugzilla-d24a52b9245badb17016ed1b3daeeb9eb266f421.tar.xz
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.
-rwxr-xr-xnew_comment.cgi12
1 files changed, 8 insertions, 4 deletions
diff --git a/new_comment.cgi b/new_comment.cgi
index 0d5ab1394..ad014514d 100755
--- a/new_comment.cgi
+++ b/new_comment.cgi
@@ -20,13 +20,17 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
+use strict;
+
+my %FORM;
+my $buffer = "";
if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; }
else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
# Split the name-value pairs
-@pairs = split(/&/, $buffer);
-foreach $pair (@pairs)
+my @pairs = split(/&/, $buffer);
+foreach my $pair (@pairs)
{
- ($name, $value) = split(/=/, $pair);
+ my ($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/^(\s*)//s;
@@ -34,7 +38,7 @@ foreach $pair (@pairs)
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
-$c=$FORM{"comment"};
+my $c = $FORM{"comment"};
if ( (!defined $c) || ($c eq '') ) {
print "Content-type: text/html\n\n";
print "<TITLE>Nothing on your mind?</TITLE>";