Make WordPress Core

Opened 5 years ago

Last modified 14 months ago

#22952 closed defect (bug)

WP_HTTP can cause PHP Warnings during attempted decompression — at Initial Version

Reported by: dd32 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: HTTP API Keywords: has-patch needs-testing
Focuses: Cc:


{{[ WARNING: wp-includes/class-http.php:1656 - gzinflate(): data error }}}

WP_Http_Encoding can cause PHP Warnings when it attempts to decompress data using gzinflate() which has been encoded in any way. We currently work around this this in a few ways, but we still take a "try it and see" method instead of detecting the compressed contents signature and handling it appropriately.

Attached is a first-run patch at detecting Huffman coding, which is what we currently use @gzinflate( substr( $gzData, 2 ) ) for (and hey, who doesn't like making magic numbers clearer?)

I have been running a similar patch on WordPress.com and gathering data on how the myriad of different Web Servers out there respond, and so far this causes it to correctly identify the vast majority of responses.

It appears that we may also be attempting to decompress compressed files retrieved through WP_HTTP on some poorly configured servers, but this is something I haven't yet traced properly.

Change History (1)

5 years ago

Note: See TracTickets for help on using tickets.