Commit 3dbd99b2 authored by Pami Ketolainen's avatar Pami Ketolainen Committed by David Lawrence

Bug 1227455 - Multiselect parameters (type 'm') are not read correctly from the…

Bug 1227455 - Multiselect parameters (type 'm') are not read correctly from the new JSON storage format r/a=dkl
parent a42b9586
......@@ -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'}) {
......
......@@ -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'}'";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment