From 437b14a0d7afbcaf66274beb016ae7938cdf2086 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 18 Nov 2009 07:09:49 +0000 Subject: Bug 529223: The JSON-RPC interface was not working at all with JSON-RPC 1.0, because it was mis-handling input parameters. Patch by Max Kanat-Alexander r=dkl, a=mkanat --- Bugzilla/WebService/Server/JSONRPC.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 919370a2a..16f9ab5b5 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -114,8 +114,10 @@ sub _argument_type_check { # JSON-RPC 1.0 requires all parameters to be passed as an array, so # we just pull out the first item and assume it's an object. + my $params_is_array; if (ref $params eq 'ARRAY') { $params = $params->[0]; + $params_is_array = 1; } taint_data($params); @@ -151,6 +153,10 @@ sub _argument_type_check { eval "package $new_class;$isa_string;"; bless $self, $new_class; + if ($params_is_array) { + $params = [$params]; + } + return $params; } -- cgit v1.2.3-24-g4f1b