summaryrefslogtreecommitdiffstats
path: root/new_comment.cgi
diff options
context:
space:
mode:
authortara%tequilarista.org <>2000-04-29 03:51:11 +0200
committertara%tequilarista.org <>2000-04-29 03:51:11 +0200
commit88240ae8797cf781bee31c592e45509b16731a73 (patch)
tree2806c8342a8a0e802a71b6b61d9f075f8f866df4 /new_comment.cgi
parentab5a3eb5f76714d8d69e63a0f8dcb16b9326dbc9 (diff)
downloadbugzilla-88240ae8797cf781bee31c592e45509b16731a73.tar.gz
bugzilla-88240ae8797cf781bee31c592e45509b16731a73.tar.xz
Fix for bug #1105--no more annoying blank quips
Diffstat (limited to 'new_comment.cgi')
-rwxr-xr-xnew_comment.cgi12
1 files changed, 11 insertions, 1 deletions
diff --git a/new_comment.cgi b/new_comment.cgi
index e561292ea..e034f3587 100755
--- a/new_comment.cgi
+++ b/new_comment.cgi
@@ -29,11 +29,21 @@ foreach $pair (@pairs)
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
+ $value =~ s/^(\s*)//s;
+ $value =~ s/(\s*)$//s;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
-open(COMMENTS, ">>data/comments");
$c=$FORM{"comment"};
+if ( (!defined $c) || ($c eq '') ) {
+ print "Content-type: text/html\n\n";
+ print "<TITLE>Nothing on your mind?</TITLE>";
+ print "<H1>Does your mind draw a blank?</H1>";
+ print "<H2> Hit back, and try again...</H2>";
+ exit 0;
+}
+
+open(COMMENTS, ">>data/comments");
print COMMENTS $FORM{"comment"} . "\n";
close(COMMENTS);
print "Content-type: text/html\n\n";