[wp-trac] [WordPress Trac] #11600: gzuncompress() error on http.php line 1824

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 5 10:46:50 UTC 2010


#11600: gzuncompress() error on http.php line 1824
--------------------------+-------------------------------------------------
 Reporter:  ipstenu       |       Owner:           
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  3.0      
Component:  HTTP          |     Version:  2.9      
 Severity:  major         |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by dd32):

 No. Just leave it as it is and live with it for now. You shouldnt see it
 again. It'll get fixed in the next release.

 If you want to change it, You can change the functions to these:
 {{{
         function decompress( $compressed, $length = null ) {

                 if ( false !== ($decompressed = @gzinflate( $compressed )
 ) )
                         return $decompressed;

                 if ( false !== ( $decompressed =
 WP_Http_Encoding::compatible_gzinflate( $compressed ) ) )
                         return $decompressed;

                 if ( false !== ( $decompressed = @gzuncompress(
 $compressed ) ) )
                         return $decompressed;

                 if ( function_exists('gzdecode') ) {
                         $decompressed = @gzdecode( $compressed );

                         if ( false !== $decompressed )
                                 return $decompressed;
                 }

                 return $compressed;
         }
 }}}

 and

 {{{
         function compatible_gzinflate($gzData) {
                 if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
                         $i = 10;
                         $flg = ord( substr($gzData, 3, 1) );
                         if ( $flg > 0 ) {
                                 if ( $flg & 4 ) {
                                         list($xlen) = unpack('v',
 substr($gzData, $i, 2) );
                                         $i = $i + 2 + $xlen;
                                 }
                                 if ( $flg & 8 )
                                         $i = strpos($gzData, "\0", $i) +
 1;
                                 if ( $flg & 16 )
                                         $i = strpos($gzData, "\0", $i) +
 1;
                                 if ( $flg & 2 )
                                         $i = $i + 2;
                         }
                         return @gzinflate( substr($gzData, $i, -8) );
                 } else {
                         return false;
                 }
         }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11600#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list