Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.1

Bug #18169 HTTP_Request2_Response::decodeDeflate fails for empty string
Submitted: 2011-01-01 23:52 UTC Modified: 2011-02-13 14:05 UTC
From: jorrit Assigned: avb
Status: Closed Package: HTTP_Request2 (version 0.5.2)
PHP Version: 5.3.4 OS: Linux
Roadmaps: 0.6.0    
Subscription  


 [2011-01-01 23:52 UTC] jorrit (Jorrit Schippers)
Description: ------------ Some HTTP servers I encounter indicate that the reply body is encoded using the inflate/deflate algorithm while there is no body at all. In those cases HTTP_Request2_Response::decodeDeflate fails because unpack() assumes at least two bytes in $data, raising an error when $data is empty. There should be some check to return an empty string when the input is an empty string. Test script: --------------- $result = HTTP_Request2_Response::decodeDeflate(''); Expected result: ---------------- $result == '' Actual result: -------------- Warning: unpack(): Type n: not enough input, need 2, have 0 in /usr/share/php/HTTP/Request2/Response.php on line 555

Comments

 [2011-02-13 14:05 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.