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

Bug #18169 HTTP_Request2_Response::decodeDeflate fails for empty string
Submitted: 2011-01-02 04:52 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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 34 + 22 = ?

 
 [2011-01-02 04: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 19: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.