Issues

ZF-2279: Sequence of calling arguments not correct

Description

If i call a Rest-Service this way: /foo?method=test&arg0=xxxx&arg1=yyyy everything works as expected.

But If I change the order of the arguments like this: /foo?method=test&arg1=yyyy&arg0=xxxx yyyy is used as first and xxxx as second argument.

I actually found the problem when using Zend_Rest_Client to access the Rest-Server - and Http_Client sometimes disorders the arguments in the request.

This little patch solves the problem:

Index: Zend/Rest/Server.php
===================================================================
--- Zend/Rest/Server.php        (revision 6541)
+++ Zend/Rest/Server.php        (working copy)
@@ -144,6 +144,7 @@
                             $calling_args[$key]= $value;
                         }
                     }
+                    ksort($calling_args);

                     if (count($calling_args) < count($func_args)) {
                         throw new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($func_args) . ', ' . count($calling_args) . ' given.', 400);

thanks, niko

Comments

Scheduling for next mini release.

Fixed in trunk and 1.5 and 1.6 release branches.