Issues

ZF-5078: Zend_Amf does not properly serialize Zend_Amf_Value_ByteArray instances

Issue Type: Bug Created: 2008-11-26T13:44:35.000+0000 Last Updated: 2008-12-21T05:20:07.000+0000 Status: Resolved Fix version(s): - 1.7.2 (23/Dec/08)

Reporter: Brad Fisher (brad_fisher@gensler.com) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments:

Description

In attempting to switch from AMFPHP to Zend_Amf, I ran across the following issue:

The AMF3 encoding doesn't seem to be correct for ByteArray instances. When returning a Zend_Amf_Value_ByteArray instance, the serializer attempts to pass the instance to its writeString method, which attempts to treat it as a simple string, causing php to send the incorrect data as well as emit a notice as follows:

bq. Notice: Object of class Zend_Amf_Value_ByteArray to string conversion

One way to avoid this and properly return the binary data to the server is to modify line 81 of Zend\Amf\Parse\Amf3\Serializer.php to read:

bq. $this->writeString($data instanceof Zend_Amf_Value_ByteArray ? $data->getData() : $data);

Comments

Posted by Wade Arnold (wadearnold) on 2008-12-12T14:31:10.000+0000

Added support for Zend_Amf_Value_ByteArray::getData into the serialization process.

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