summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-06-26 08:00:05 +0200
committermkanat%bugzilla.org <>2008-06-26 08:00:05 +0200
commit4a0e946fb30212c232c6651a47e057d6cc602a1d (patch)
treea1e4af20b94d12785858aa41cf79aec9eecf0808 /Bugzilla/WebService
parent6de90de1f2db0766633cc188bfe800b6980f4925 (diff)
downloadbugzilla-4a0e946fb30212c232c6651a47e057d6cc602a1d.tar.gz
bugzilla-4a0e946fb30212c232c6651a47e057d6cc602a1d.tar.xz
Bug 440609 – Implement Bugzilla::Bug->check for use instead of ValidateBugID and use it in one file
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/WebService')
-rwxr-xr-xBugzilla/WebService/Bug.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 9463bce73..dd866a67b 100755
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -75,8 +75,7 @@ sub get {
my @return;
foreach my $bug_id (@$ids) {
- ValidateBugID($bug_id);
- my $bug = new Bugzilla::Bug($bug_id);
+ my $bug = Bugzilla::Bug->check($bug_id);
# Timetracking fields are deleted if the user doesn't belong to
# the corresponding group.
@@ -247,14 +246,12 @@ sub add_comment {
# Check parameters
defined $params->{id}
- || ThrowCodeError('param_required', { param => 'id' });
- ValidateBugID($params->{id});
-
+ || ThrowCodeError('param_required', { param => 'id' });
my $comment = $params->{comment};
defined $comment
|| ThrowCodeError('param_required', { param => 'comment' });
- my $bug = new Bugzilla::Bug($params->{id});
+ my $bug = Bugzilla::Bug->check($params->{id});
Bugzilla->user->can_edit_product($bug->product_id)
|| ThrowUserError("product_edit_denied", {product => $bug->product});