ZF-6040: decodeDeflate() handles incorrectly
Description
Zend_Http_Response::decodeDeflate's errors"Warning: gzuncompress(): data error " this is maybe same Http_Request2_Response's bug .http://pear.php.net/bugs/bug.php?id=15305.
I found it be solved - override Http_Request2_Response::decodeDeflate method's code
Comments
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 http://www.gbase.de/global/news/0/55322.html, and the body is processed to gzuncompress instead gzinflate (because $zlibHeader[1] % 31 == 0).
I have found a solution at http://php.net/manual/en/…
(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
Ok, http://framework.zend.com/issues/browse/ZF-12457.