]> 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:26:10 +0000 (17:26 +0000)
r/a=dkl

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

index b4ff803bd4047fb1d7c32e40f3ff0e4b61c5d6bd..1c02d9ddac877f3d2820ce0cf3c4ce0c6a879ae8 100644 (file)
@@ -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'}) {
index e8dfe3e9d1ee0ff7e5a4ee82049236a4fd49278e..bd9b0bf84490cffec25f74db679da6454f277408 100644 (file)
@@ -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'}'";
             }