missing check in WP_Http_Encoding::decompress() leads to gzuncompress errors
|Reported by:||rowanbeentje||Owned by:||dd32|
We have a custom PHP error handler which catches errors (both trigger_error'd and fatal) and files them in a tracking system; over the last few weeks we've had quite a few occurrences of "gzuncompress() : data error" thrown in WP_Http_Encoding::decompress().
When I first looked into this I found #11600, and thought that was the cause; as a result I took the http.php file from http://core.trac.wordpress.org/export/11450/trunk/wp-includes/http.php and dropped that in over the 2.9.1 version. Unfortunately that hasn't stopped the occurrences!
Fortunately our error handler captures a backtrace and some context; as a result, I can see that WP_Http_Encoding::decompress() is called with one argument: false. gzinflate simply returns false when it is passed false, but gzuncompress throws an E_WARNING.
I'm not entirely sure why decompress() is being passed false - my suspicion is that the curl request is timing out, but that decompress is called on the result anyway? I haven't followed the logic through completely…
Here's an abbreviated backtrace; let me know if you need more detail.
WP_Http::head(<snip url>, array())
WP_Http_Curl::request(<snip url>, array(method:head, timeout:5, redirection:5, httpversion:1.0, etc etc))
Change History (5)
- Keywords needs-patch added; gzuncompress decompress http cron removed
- Milestone changed from Unassigned to 3.0
- Summary changed from gzuncompress errors in WP_Http_Encoding::decompress() to missing check in WP_Http_Encoding::decompress() leads to gzuncompress errors