Zend Framework

Sequence of calling arguments not correct

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.3
  • Fix Version/s: 1.5.3
  • Component/s: Zend_Rest_Server
  • Labels:
    None
  • Fix Version Priority:
    Must Have

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

Activity

Hide
Matthew Weier O'Phinney added a comment -

Scheduling for next mini release.

Show
Matthew Weier O'Phinney added a comment - Scheduling for next mini release.
Hide
Matthew Weier O'Phinney added a comment -

Fixed in trunk and 1.5 and 1.6 release branches.

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk and 1.5 and 1.6 release branches.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
30m
Original Estimate - 30 minutes
Remaining:
30m
Remaining Estimate - 30 minutes
Logged:
Not Specified
Time Spent - Not Specified