Issues

ZF-2279: Sequence of calling arguments not correct

Issue Type: Bug Created: 2007-12-07T07:25:01.000+0000 Last Updated: 2008-07-23T11:52:20.000+0000 Status: Resolved Fix version(s): - 1.5.3 (28/Jul/08)

Reporter: Niko Sams (nikosams) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Rest_Server

Related issues: Attachments:

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:

<pre class="literal">
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

Posted by Matthew Weier O'Phinney (matthew) on 2008-05-09T11:57:17.000+0000

Scheduling for next mini release.

Posted by Matthew Weier O'Phinney (matthew) on 2008-07-23T11:52:19.000+0000

Fixed in trunk and 1.5 and 1.6 release branches.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts