From: Pami Ketolainen Date: Wed, 25 Nov 2015 17:24:32 +0000 (+0000) Subject: Bug 1227455 - Multiselect parameters (type 'm') are not read correctly from the new... X-Git-Tag: release-5.0.2~21 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3dbd99b27e6c2abba5462f161305b6413d8cb91d;p=thirdparty%2Fbugzilla.git Bug 1227455 - Multiselect parameters (type 'm') are not read correctly from the new JSON storage format r/a=dkl --- diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index b4ff803bd4..1c02d9ddac 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -315,7 +315,13 @@ sub read_param_file { } # JSON::XS doesn't detaint data for us. foreach my $key (keys %params) { - trick_taint($params{$key}) if defined $params{$key}; + if (ref($params{$key}) eq "ARRAY") { + foreach my $item (@{$params{$key}}) { + trick_taint($item); + } + } else { + trick_taint($params{$key}) if defined $params{$key}; + } } } elsif ($ENV{'SERVER_SOFTWARE'}) { diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index e8dfe3e9d1..bd9b0bf844 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -45,7 +45,10 @@ sub check_multi { return ""; } elsif ($param->{'type'} eq 'm' || $param->{'type'} eq 'o') { - foreach my $chkParam (split(',', $value)) { + if (ref($value) ne "ARRAY") { + $value = [split(',', $value)] + } + foreach my $chkParam (@$value) { unless (scalar(grep {$_ eq $chkParam} (@{$param->{'choices'}}))) { return "Invalid choice '$chkParam' for multi-select list param '$param->{'name'}'"; }