ZF-12457: decodeDeflate() handles incorrectly

Issue Type: Bug Created: 2012-10-29T15:37:52.000+0000 Last Updated: 2012-11-09T10:03:01.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Patrick Günther (patrickg) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Response

Related issues: Attachments:


It seems the fix ( is not enough.

I'm tring to receive the response from, and the raw 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:

<pre class="highlight">
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 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:…

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.