[wp-trac] [WordPress Trac] #22952: WP_HTTP can cause PHP Warnings during attempted decompression

WordPress Trac noreply at wordpress.org
Sat Dec 15 05:13:55 UTC 2012


#22952: WP_HTTP can cause PHP Warnings during attempted decompression
-------------------------------------+-------------------------
 Reporter:  dd32                     |       Type:  enhancement
   Status:  new                      |   Priority:  normal
Milestone:  3.6                      |  Component:  HTTP
  Version:                           |   Severity:  normal
 Keywords:  has-patch needs-testing  |
-------------------------------------+-------------------------
 {{[
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22952>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list