]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 466406: Passing an empty comment to Bug.add_comment fails silently
authormkanat%bugzilla.org <>
Wed, 26 Nov 2008 00:53:29 +0000 (00:53 +0000)
committermkanat%bugzilla.org <>
Wed, 26 Nov 2008 00:53:29 +0000 (00:53 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat

Bugzilla/WebService/Bug.pm

index 2df15081be08bf429b1c54827cd296134d2dfb31..e8b7dd3e49f8508313a36163d574b1095bacd54c 100755 (executable)
@@ -29,6 +29,7 @@ use Bugzilla::Field;
 use Bugzilla::WebService::Constants;
 use Bugzilla::Bug;
 use Bugzilla::BugMail;
+use Bugzilla::Util qw(trim);
 
 #############
 # Constants #
@@ -190,7 +191,7 @@ sub add_comment {
     ValidateBugID($params->{id});
     
     my $comment = $params->{comment}; 
-    defined $comment
+    (defined $comment && trim($comment) ne '')
         || ThrowCodeError('param_required', { param => 'comment' });
     
     my $bug = new Bugzilla::Bug($params->{id});
@@ -525,6 +526,8 @@ This allows you to add a comment to a bug in Bugzilla.
 comment to.
 
 =item C<comment> (string) B<Required> - The comment to append to the bug.
+If this is empty or all whitespace, an error will be thrown saying that
+you did not set the C<comment> parameter.
 
 =item C<private> (boolean) - If set to true, the comment is private, otherwise
 it is assumed to be public.