Summery Summery
Decompression of deflated string.
Syntax Syntax
Description Description
Will attempt to decompress using the RFC 1950 standard, and if that fails then the RFC 1951 standard deflate will be attempted. Finally, the RFC 1952 standard gzip decode will be attempted. If all fail, then the original compressed string will be returned.
Parameters Parameters
- $compressed
-
(Required) String to decompress.
- $length
-
(Optional) The optional length of the compressed data.
Default value: null
Return Return
(string|bool) False on failure.
Source Source
File: wp-includes/class-wp-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;
Advertisement
Changelog Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |