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";