From: mkanat%bugzilla.org <> Date: Wed, 18 Nov 2009 07:09:49 +0000 (+0000) Subject: Bug 529223: The JSON-RPC interface was not working at all with JSON-RPC 1.0, because... X-Git-Tag: bugzilla-3.5.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=437b14a0d7afbcaf66274beb016ae7938cdf2086;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 919370a2a2..16f9ab5b5d 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; }