GC_Http_Encoding::decompress()
最后更新于:2021-12-01 11:12:47
GC_( string$compressed, int$length=null)Decompression of deflated string.
参数
- $compressed
-
(string) (Required) String to decompress.
- $length
-
(int) (Optional) The optional length of the compressed data.
Default value: null
响应
(string|false) Decompressed string on success, false on failure.
源文件
文件: gc-includes/class-gc-http-encoding.php
public static function decompress( $compressed, $length = null ) {
if ( empty( $compressed ) ) {
return $compressed;
}
$decompressed = @gzinflate( $compressed );
if ( false !== $decompressed ) {
return $decompressed;
}
$decompressed = self::compatible_gzinflate( $compressed );
if ( false !== $decompressed ) {
return $decompressed;
}
$decompressed = @gzuncompress( $compressed );
if ( false !== $decompressed ) {
return $decompressed;
}
if ( function_exists( 'gzdecode' ) ) {
$decompressed = @gzdecode( $compressed );
if ( false !== $decompressed ) {
return $decompressed;
}
}
return $compressed;
}