Commit 9b37668c authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 577765: Allow XML-RPC to accept multiple positional parameters

r=ghendricks, a=mkanat
parent 5b82a3b7
...@@ -152,13 +152,15 @@ use Bugzilla::WebService::Util qw(taint_data); ...@@ -152,13 +152,15 @@ use Bugzilla::WebService::Util qw(taint_data);
sub paramsin { sub paramsin {
my $self = shift; my $self = shift;
return $self->{bz_params_in} if $self->{bz_params_in}; if (!$self->{bz_params_in}) {
my $params = $self->SUPER::paramsin(@_); my @params = $self->SUPER::paramsin(@_);
if ($self->{_bz_do_taint}) { if ($self->{_bz_do_taint}) {
taint_data($params); taint_data(@params);
}
$self->{bz_params_in} = \@params;
} }
$self->{bz_params_in} = $params; my $params = $self->{bz_params_in};
return $self->{bz_params_in}; return wantarray ? @$params : $params->[0];
} }
1; 1;
......
...@@ -52,13 +52,13 @@ sub filter ($$) { ...@@ -52,13 +52,13 @@ sub filter ($$) {
} }
sub taint_data { sub taint_data {
my $params = shift; my @params = @_;
return if !$params; return if !@params;
# Though this is a private function, it hasn't changed since 2004 and # Though this is a private function, it hasn't changed since 2004 and
# should be safe to use, and prevents us from having to write it ourselves # should be safe to use, and prevents us from having to write it ourselves
# or require another module to do it. # or require another module to do it.
Test::Taint::_deeply_traverse(\&_delete_bad_keys, $params); Test::Taint::_deeply_traverse(\&_delete_bad_keys, \@params);
Test::Taint::taint_deeply($params); Test::Taint::taint_deeply(\@params);
} }
sub _delete_bad_keys { sub _delete_bad_keys {
......
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