summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-11-26 01:52:34 +0100
committermkanat%bugzilla.org <>2008-11-26 01:52:34 +0100
commit5bf043eea026fbc8f0834736f213d946599991ed (patch)
tree02f6ecd9583d19f4ad6b31e4c9d2d41235bfe6cb /Bugzilla/WebService
parentbb9d68e207399115fdc8bb067d855f1323cbf3c4 (diff)
downloadbugzilla-5bf043eea026fbc8f0834736f213d946599991ed.tar.gz
bugzilla-5bf043eea026fbc8f0834736f213d946599991ed.tar.xz
Bug 466406: Passing an empty comment to Bug.add_comment fails silently
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/WebService')
-rwxr-xr-xBugzilla/WebService/Bug.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index b6411968c..d60f5015b 100755
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -29,6 +29,7 @@ use Bugzilla::Field;
use Bugzilla::WebService::Constants;
use Bugzilla::Bug;
use Bugzilla::BugMail;
+use Bugzilla::Util qw(trim);
#############
# Constants #
@@ -233,7 +234,7 @@ sub add_comment {
defined $params->{id}
|| ThrowCodeError('param_required', { param => 'id' });
my $comment = $params->{comment};
- defined $comment
+ (defined $comment && trim($comment) ne '')
|| ThrowCodeError('param_required', { param => 'comment' });
my $bug = Bugzilla::Bug->check($params->{id});
@@ -655,6 +656,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.