summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config/Common.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config/Common.pm')
-rw-r--r--Bugzilla/Config/Common.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 7416b1794..8fc1b6037 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -144,7 +144,7 @@ sub check_utf8 {
sub check_priority {
my ($value) = (@_);
my $legal_priorities = get_legal_field_values('priority');
- if (lsearch($legal_priorities, $value) < 0) {
+ if (!grep($_ eq $value, @$legal_priorities)) {
return "Must be a legal priority value: one of " .
join(", ", @$legal_priorities);
}
@@ -154,7 +154,7 @@ sub check_priority {
sub check_severity {
my ($value) = (@_);
my $legal_severities = get_legal_field_values('bug_severity');
- if (lsearch($legal_severities, $value) < 0) {
+ if (!grep($_ eq $value, @$legal_severities)) {
return "Must be a legal severity value: one of " .
join(", ", @$legal_severities);
}
@@ -164,7 +164,7 @@ sub check_severity {
sub check_platform {
my ($value) = (@_);
my $legal_platforms = get_legal_field_values('rep_platform');
- if (lsearch(['', @$legal_platforms], $value) < 0) {
+ if (!grep($_ eq $value, '', @$legal_platforms)) {
return "Must be empty or a legal platform value: one of " .
join(", ", @$legal_platforms);
}
@@ -174,7 +174,7 @@ sub check_platform {
sub check_opsys {
my ($value) = (@_);
my $legal_OS = get_legal_field_values('op_sys');
- if (lsearch(['', @$legal_OS], $value) < 0) {
+ if (!grep($_ eq $value, '', @$legal_OS)) {
return "Must be empty or a legal operating system value: one of " .
join(", ", @$legal_OS);
}
@@ -184,7 +184,7 @@ sub check_opsys {
sub check_bug_status {
my $bug_status = shift;
my @closed_bug_statuses = map {$_->name} closed_bug_statuses();
- if (lsearch(\@closed_bug_statuses, $bug_status) < 0) {
+ if (!grep($_ eq $bug_status, @closed_bug_statuses)) {
return "Must be a valid closed status: one of " . join(', ', @closed_bug_statuses);
}
return "";