Changeset 52150
- Timestamp:
- 11/12/2021 11:50:07 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-http-encoding.php
r49963 r52150 98 98 * @link https://www.php.net/manual/en/function.gzinflate.php#77336 99 99 * 100 * @param string $gz Data String to decompress.100 * @param string $gz_data String to decompress. 101 101 * @return string|false Decompressed string on success, false on failure. 102 102 */ 103 public static function compatible_gzinflate( $gz Data ) {103 public static function compatible_gzinflate( $gz_data ) { 104 104 105 105 // Compressed data might contain a full header, if so strip it for gzinflate(). 106 if ( "\x1f\x8b\x08" === substr( $gz Data, 0, 3 ) ) {106 if ( "\x1f\x8b\x08" === substr( $gz_data, 0, 3 ) ) { 107 107 $i = 10; 108 $flg = ord( substr( $gz Data, 3, 1 ) );108 $flg = ord( substr( $gz_data, 3, 1 ) ); 109 109 if ( $flg > 0 ) { 110 110 if ( $flg & 4 ) { 111 list($xlen) = unpack( 'v', substr( $gz Data, $i, 2 ) );111 list($xlen) = unpack( 'v', substr( $gz_data, $i, 2 ) ); 112 112 $i = $i + 2 + $xlen; 113 113 } 114 114 if ( $flg & 8 ) { 115 $i = strpos( $gz Data, "\0", $i ) + 1;115 $i = strpos( $gz_data, "\0", $i ) + 1; 116 116 } 117 117 if ( $flg & 16 ) { 118 $i = strpos( $gz Data, "\0", $i ) + 1;118 $i = strpos( $gz_data, "\0", $i ) + 1; 119 119 } 120 120 if ( $flg & 2 ) { … … 122 122 } 123 123 } 124 $decompressed = @gzinflate( substr( $gz Data, $i, -8 ) );124 $decompressed = @gzinflate( substr( $gz_data, $i, -8 ) ); 125 125 if ( false !== $decompressed ) { 126 126 return $decompressed; … … 129 129 130 130 // Compressed data from java.util.zip.Deflater amongst others. 131 $decompressed = @gzinflate( substr( $gz Data, 2 ) );131 $decompressed = @gzinflate( substr( $gz_data, 2 ) ); 132 132 if ( false !== $decompressed ) { 133 133 return $decompressed;
Note: See TracChangeset
for help on using the changeset viewer.