From 88240ae8797cf781bee31c592e45509b16731a73 Mon Sep 17 00:00:00 2001 From: "tara%tequilarista.org" <> Date: Sat, 29 Apr 2000 01:51:11 +0000 Subject: Fix for bug #1105--no more annoying blank quips --- new_comment.cgi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 "Nothing on your mind?"; + print "

Does your mind draw a blank?

"; + print "

Hit back, and try again...

"; + exit 0; +} + +open(COMMENTS, ">>data/comments"); print COMMENTS $FORM{"comment"} . "\n"; close(COMMENTS); print "Content-type: text/html\n\n"; -- cgit v1.2.1