wp/wp-includes/class-wp-http-encoding.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/class-wp-http-encoding.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/class-wp-http-encoding.php	Tue Dec 15 13:49:49 2020 +0100
@@ -23,9 +23,10 @@
 	 *
 	 * @since 2.8.0
 	 *
-	 * @param string $raw String to compress.
-	 * @param int $level Optional, default is 9. Compression level, 9 is highest.
-	 * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports.
+	 * @param string $raw      String to compress.
+	 * @param int    $level    Optional. Compression level, 9 is highest. Default 9.
+	 * @param string $supports Optional, not used. When implemented it will choose
+	 *                         the right compression based on what the server supports.
 	 * @return string|false False on failure.
 	 */
 	public static function compress( $raw, $level = 9, $supports = null ) {
@@ -43,7 +44,7 @@
 	 * @since 2.8.0
 	 *
 	 * @param string $compressed String to decompress.
-	 * @param int $length The optional length of the compressed data.
+	 * @param int    $length     The optional length of the compressed data.
 	 * @return string|bool False on failure.
 	 */
 	public static function decompress( $compressed, $length = null ) {
@@ -52,15 +53,18 @@
 			return $compressed;
 		}
 
-		if ( false !== ( $decompressed = @gzinflate( $compressed ) ) ) {
+		$decompressed = @gzinflate( $compressed );
+		if ( false !== $decompressed ) {
 			return $decompressed;
 		}
 
-		if ( false !== ( $decompressed = self::compatible_gzinflate( $compressed ) ) ) {
+		$decompressed = self::compatible_gzinflate( $compressed );
+		if ( false !== $decompressed ) {
 			return $decompressed;
 		}
 
-		if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) ) {
+		$decompressed = @gzuncompress( $compressed );
+		if ( false !== $decompressed ) {
 			return $decompressed;
 		}
 
@@ -88,9 +92,10 @@
 	 * https://core.trac.wordpress.org/ticket/18273
 	 *
 	 * @since 2.8.1
+	 *
 	 * @link https://core.trac.wordpress.org/ticket/18273
-	 * @link https://secure.php.net/manual/en/function.gzinflate.php#70875
-	 * @link https://secure.php.net/manual/en/function.gzinflate.php#77336
+	 * @link https://www.php.net/manual/en/function.gzinflate.php#70875
+	 * @link https://www.php.net/manual/en/function.gzinflate.php#77336
 	 *
 	 * @param string $gzData String to decompress.
 	 * @return string|bool False on failure.
@@ -98,7 +103,7 @@
 	public static function compatible_gzinflate( $gzData ) {
 
 		// Compressed data might contain a full header, if so strip it for gzinflate().
-		if ( substr( $gzData, 0, 3 ) == "\x1f\x8b\x08" ) {
+		if ( "\x1f\x8b\x08" === substr( $gzData, 0, 3 ) ) {
 			$i   = 10;
 			$flg = ord( substr( $gzData, 3, 1 ) );
 			if ( $flg > 0 ) {
@@ -171,10 +176,9 @@
 		 *
 		 * @since 3.6.0
 		 *
-		 * @param array  $type Encoding types allowed. Accepts 'gzinflate',
-		 *                     'gzuncompress', 'gzdecode'.
-		 * @param string $url  URL of the HTTP request.
-		 * @param array  $args HTTP request arguments.
+		 * @param string[] $type Array of what encoding types to accept and their priority values.
+		 * @param string   $url  URL of the HTTP request.
+		 * @param array    $args HTTP request arguments.
 		 */
 		$type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );