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

Bug #16555 mbstring.func_overload breaks decodeGzip()
Submitted: 2009-08-30 01:44 UTC
From: shupp Assigned: avb
Status: Closed Package: HTTP_Request2 (version 0.4.0)
PHP Version: Irrelevant OS: linux
Roadmaps: (Not assigned)    
Subscription  


 [2009-08-30 01:44 UTC] shupp (Bill Shupp)
Description: ------------ When mbstring.func_overload 2 is enabled, gzip decoding breaks because the string length/ substring related functions specify the wrong location of the encoded section of the string, resulting in a PHP warning and an HTTP_Request2_Exception. Test script: --------------- <?php require_once 'HTTP/Request2.php'; $url = "http://search.twitter.com/search.json?q=bill+OR+shupp&rpp=100&since_id=3608038665"; $http = new HTTP_Request2($url); $response = $http->send(); echo $response->getBody(); ?> Expected result: ---------------- search results in json Actual result: -------------- PHP Warning: gzinflate(): buffer error in /usr/share/php/HTTP/Request2/Response.php on line 497 Warning: gzinflate(): buffer error in /usr/share/php/HTTP/Request2/Response.php on line 497 PHP Fatal error: Uncaught HTTP_Request2_Exception: gzinflate() call failed in /usr/share/php/HTTP/Request2/Response.php on line 394 #0 /usr/share/php/HTTP/Request2/Response.php(394): HTTP_Request2_Response::decodeGzip('???????????}?s?...') #1 /home/bill/request.php(10): HTTP_Request2_Response->getBody() #2 {main} thrown in /usr/share/php/HTTP/Request2/Response.php on line 499 Fatal error: Uncaught HTTP_Request2_Exception: gzinflate() call failed in /usr/share/php/HTTP/Request2/Response.php on line 394 #0 /usr/share/php/HTTP/Request2/Response.php(394): HTTP_Request2_Response::decodeGzip('???????????}?s?...') #1 /home/bill/request.php(10): HTTP_Request2_Response->getBody() #2 {main} thrown in /usr/share/php/HTTP/Request2/Response.php on line 499

Comments

 [2009-08-30 01:46 UTC] shupp (Bill Shupp)
The following patch has been added/updated: Patch Name: fix-mbstring-overloading Revision: 1251578761 URL: http://pear.php.net/bugs/patch-display.php?bug=16555&patch=fix-mbstring-overloading&revision=1251578761&display=1
 [2009-09-01 23:56 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
This bug has been fixed in CVS. 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. -------- Changed the patch a bit to do exception handling and cleanup like in HTTP_Request2::send(). In fact this bug broke even existing unit tests if mbstring.func_overload was enabled.
 [2023-08-11 10:58 UTC] thies (Thies C. Arntzen)
???