Issues

ZF-11083: Zend_AMF unable to deserialize multiple AMF3 items

Issue Type: Bug Created: 2011-02-17T03:22:37.000+0000 Last Updated: 2011-02-17T03:22:37.000+0000 Status: Open Fix version(s): Reporter: Richard Chiswell (richard.chiswell@mangahigh.com) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments:

Description

If an AMF request is received which has (according to Charles Proxy): AMF Message: Type Message Header Body [0] Target String Gateway.dostuff Response String /3 Content Array [0] Object .com.main language string ABC something string def [1] Object .com.other foo string ghi bar string jkl language string reference ABC

with a matching class declaration of class Wrapper { public function dostuff(DTO_Main $main,DTO_other $other) { } } The then contents of $other (which maps to the second object) will have "language" set to "ghi" instead of "ABC".

Hard to explain in an example, but here's what's happening: Flash is sending all the strings as reference mappings. So above: Item 1: "language" from com.main. Store text "ABC" as string 1 Item 2: "something" from com.main. Store text "def" as string 2 Item 3: "foo" from "com.other". Store text "ghi" as string 3 Item 4: "bar" from "com.other". Store text "jkl" as string 4 Item 5: "language" form "com.other". Retrieve string "1" (which returns "ABC").

However, Zend_AMF is treating the two AMF3 objects being returned as totally isolated items. Therefore it is handling the above as: Item 1: "language" from com.main. Store text "ABC" as string 1 Item 2: "something" from com.main. Store text "def" as string 2 Item 3: "foo" from "com.other". Store text "ghi" as string 1 Item 4: "bar" from "com.other". Store text "jkl" as string 2 Item 5: "language" form "com.other". Retrieve string "1" (which returns "ghi").

Work around: Modify Zend/Amf/Parse/Amf3: protected $_referenceStrings = array(); change to: private static $_referenceString = array(); Change all references in that file of: $this->_referenceStrings to: self::$_referenceStrings

Comments

No comments to display

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