]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1227455 - Multiselect parameters (type 'm') are not read correctly from the new...
authorPami Ketolainen <pami.ketolainen@gmail.com>
Wed, 25 Nov 2015 17:24:32 +0000 (17:24 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Wed, 25 Nov 2015 17:24:32 +0000 (17:24 +0000)
r/a=dkl

Bugzilla/Config.pm
Bugzilla/Config/Common.pm

index 0d61abb7de68dec7c8728ca76309d4b4e9a6e997..5dfe2e37d9a79ad747a6c6d3b13664f2b11adaec 100644 (file)
@@ -309,7 +309,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'}) {
index 6f0c0d4705251fc1725aa382511a8da9a50e4071..6e8ae7b61b5b6e4cfb12fa17410ee0cf27a13044 100644 (file)
@@ -44,7 +44,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'}'";
             }