diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-05-06 22:42:31 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-05-06 22:42:31 +0200 |
commit | f0fede65121748fb8b5404a0bdde3616d37eaf51 (patch) | |
tree | bdb944c3a31f0564459ce390fc94ff4afb5c6b41 /Bugzilla/Bug.pm | |
parent | c60cce7d4f4f175ddf723d9def271ad9a964034a (diff) | |
download | bugzilla-f0fede65121748fb8b5404a0bdde3616d37eaf51.tar.gz bugzilla-f0fede65121748fb8b5404a0bdde3616d37eaf51.tar.xz |
Bug 653341: Bug.create() fails to error out if an invalid group is passed
r/a=mkanat
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index beafcfa8c..f3d635344 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1641,11 +1641,14 @@ sub _check_groups { # First check all the groups they chose to set. foreach my $name (@$group_names) { - # We don't want to expose the existence or non-existence of groups, - # so instead of doing check(), we just do "next" on an invalid - # group. - my $group = new Bugzilla::Group({ name => $name }) or next; - next if !$product->group_is_settable($group); + my $group = Bugzilla::Group->check( + { name => $name, product => $product, + _error => 'group_restriction_not_allowed' }); + + if (!$product->group_is_settable($group)) { + ThrowUserError('group_restriction_not_allowed', + { name => $name, product => $product }); + } $add_groups{$group->id} = $group; } } |