ZF-12457: decodeDeflate() handles incorrectly
Description
It seems the fix (http://framework.zend.com/issues/browse/ZF-6040) is not enough.
I'm tring to receive the response from http://www.gbase.de/global/news/0/55322.html, and the raw 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);
Comments
Posted by Rob Allen (rob) on 2012-11-06T20:19:54.000+0000
Fixed on trunk (25078) and release-1.12 (25079)
Posted by Patrick Günther (patrickg) on 2012-11-06T21:29:56.000+0000
It also must be changed in ZF2: https://github.com/zendframework/zf2/…