ZF-6040: decodeDeflate() handles incorrectly

Issue Type: Bug Created: 2009-03-16T07:54:55.000+0000 Last Updated: 2012-10-29T15:38:37.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Kazusuke Sasezaki (sasezaki) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Response

Related issues: Attachments:


Zend_Http_Response::decodeDeflate's errors"Warning: gzuncompress(): data error " this is maybe same Http_Request2_Response's bug .

I found it be solved - override Http_Request2_Response::decodeDeflate method's code


Posted by Shahar Evron (shahar) on 2009-07-25T02:30:19.000+0000

Thanks for reporting and for the link to PEAR - fixed in rev. 17055

Posted by Patrick Günther (patrickg) on 2012-10-29T11:29:00.000+0000

It seems this is not enough.

I'm tring to recieve the response from, and the body is processed to gzuncompress instead gzinflate (because $zlibHeader[1] % 31 == 0).

I have found a solution at…

(ord($body[0]) == 0x78 && in_array(ord($body[1]), array(0x01, 0x5e, 0x9c, 0xda)) is false.

So, it should look like this:

if ($zlibHeader[1] % 31 == 0 && ord($body[0]) == 0x78 && in_array(ord($body[1]), array(0x01, 0x5e, 0x9c, 0xda)) { return gzuncompress($body); }

return gzinflate($body);

Posted by Kazusuke Sasezaki (sasezaki) on 2012-10-29T13:22:22.000+0000

Hi Patrick. Thank you for comment. Could you open your suggestion as other issue?

Posted by Patrick Günther (patrickg) on 2012-10-29T15:38:37.000+0000


Have you found an issue?

See the Overview section for more details.


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

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