WordPress.org

Make WordPress Core

Changeset 18718


Ignore:
Timestamp:
09/19/2011 02:43:43 PM (7 years ago)
Author:
dd32
Message:

Add inflation support for java.util.zip.Deflater in WP_Http_Encoding::compatible_gzinflate(). Fixes #18273

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-http.php

    r18633 r18718  
    16371637     */
    16381638    function compatible_gzinflate($gzData) {
     1639
     1640        // Compressed data might contain a full header, if so strip it for gzinflate()
    16391641        if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
    16401642            $i = 10;
     
    16521654                    $i = $i + 2;
    16531655            }
    1654             return gzinflate( substr($gzData, $i, -8) );
    1655         } else {
    1656             return false;
    1657         }
     1656            $decompressed = @gzinflate( substr($gzData, $i, -8) );
     1657            if ( false !== $decompressed )
     1658                return $decompressed;
     1659        }
     1660
     1661        // Compressed data from java.util.zip.Deflater amongst others.
     1662        $decompressed = @gzinflate( substr($gzData, 2) );
     1663        if ( false !== $decompressed )
     1664            return $decompressed;
     1665
     1666        return false;
    16581667    }
    16591668
Note: See TracChangeset for help on using the changeset viewer.