diff options
Diffstat (limited to 'Bugzilla')
-rwxr-xr-x | Bugzilla/Bug.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 343f49e18..9c9e2828d 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -35,6 +35,7 @@ use Bugzilla::Constants; use Bugzilla::Field; use Bugzilla::Flag; use Bugzilla::FlagType; +use Bugzilla::Keyword; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; @@ -333,6 +334,21 @@ sub _check_component { return $obj; } +sub _check_keywords { + my ($keyword_string) = @_; + $keyword_string = trim($keyword_string); + return [] if (!$keyword_string || !Bugzilla->user->in_group('editbugs')); + + my %keyword_ids; + foreach my $keyword (split(/[\s,]+/, $keyword_string)) { + next unless $keyword; + my $obj = new Bugzilla::Keyword({ name => $keyword }); + ThrowUserError("unknown_keyword", { keyword => $keyword }) if !$obj; + $keyword_ids{$obj->id} = 1; + } + return [keys %keyword_ids]; +} + sub _check_product { my ($name) = @_; # Check that the product exists and that the user |