summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-11-18 08:09:49 +0100
committermkanat%bugzilla.org <>2009-11-18 08:09:49 +0100
commit437b14a0d7afbcaf66274beb016ae7938cdf2086 (patch)
tree39a0a0969cbb42c3d66b045a2b6dfdfb773cc314
parent62d123f695e334fbb8f0d23ad214cfc05ed37518 (diff)
downloadbugzilla-437b14a0d7afbcaf66274beb016ae7938cdf2086.tar.gz
bugzilla-437b14a0d7afbcaf66274beb016ae7938cdf2086.tar.xz
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 <mkanat@bugzilla.org> r=dkl, a=mkanat
-rw-r--r--Bugzilla/WebService/Server/JSONRPC.pm6
1 files changed, 6 insertions, 0 deletions
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;
}