Details
Description
The method _handle(Zend_Amf_Request $request) of Zend_Amf_Server handles the passed arguments wrong when the message is of type AMF3 and sent via NetConnection.
Current source code Zend/Amf/Server.php line 306:
$return = $this->_dispatch($method, array($body->getData()), $source);
Since the bodies data is already an array containing all passed arguments wrapping them in another array is wrong and should be modified to:
$return = $this->_dispatch($method, $body->getData(), $source);
Else the number of passed arguments is always one - even if multiple arguments have been sent from flash - sincethe first argument is an array containing all arguments.
In the following line 309 it is done correctly when dealing with only a different kind of method signature.
One minor note:
$body->getData()
could be replaced by:
$message
in both line (306 and 309)
Issue Links
| This issue is dependecy of: | ||||
| ZF-5831 | Zend_Amf_Server getDirectory returns the wrong variable |
|
|
|
1. |
Merging ZF-5388 to release branch | |
|
Wade Arnold |
hi, I'm not sure I understood well but it might be why I got something working with amfphp but not zend amf.
I'm trying to pass 3 arguments to a method:
1. a string
2. a array of string
3. a string
public function getDataWidthArrayParam($str1, $arr, $str2) {
array_push($arr, "a", "b", "c");
return $arr;
}
and I get a:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion
while the same php is working with amfphp.
Also, if I pass an array (to a method that is waiting for one array) and return it with some changes, I get:
with amfphp:
result:
[0] = 1
[1] = 2
[2] = 2
with zend amf:
result:
[0] =
[0] = 1
[1] = 2
[2] = 2
Shouldn't I get a normal array (like amfphp) instead of an array of one element containing the array returned?
Romu
www.soundstep.com