Issues

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:

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:

<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);

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/…

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