From 9732f62d8f0f68aecd00446ba2e2ab036435ca58 Mon Sep 17 00:00:00 2001 From: "tara%tequilarista.org" Date: Fri, 28 Apr 2000 18:51:11 +0000 Subject: [PATCH] Fix for bug #1105--no more annoying blank quips git-svn-id: svn://10.0.0.236/trunk@67542 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/new_comment.cgi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/new_comment.cgi b/mozilla/webtools/bugzilla/new_comment.cgi index e561292eac6..e034f3587d5 100755 --- a/mozilla/webtools/bugzilla/new_comment.cgi +++ b/mozilla/webtools/bugzilla/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";