Make WordPress Core


Ignore:
Timestamp:
11/12/2021 11:50:07 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $gzData argument to $gz_data in WP_Http_Encoding::compatible_gzinflate().

This fixes a Variable "$gzData" is not in valid snake_case format WPCS warning.

Follow-up to [11684].

See #53359.

File:
1 edited

Legend:

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

    r49963 r52150  
    9898         * @link https://www.php.net/manual/en/function.gzinflate.php#77336
    9999         *
    100          * @param string $gzData String to decompress.
     100         * @param string $gz_data String to decompress.
    101101         * @return string|false Decompressed string on success, false on failure.
    102102         */
    103         public static function compatible_gzinflate( $gzData ) {
     103        public static function compatible_gzinflate( $gz_data ) {
    104104
    105105                // Compressed data might contain a full header, if so strip it for gzinflate().
    106                 if ( "\x1f\x8b\x08" === substr( $gzData, 0, 3 ) ) {
     106                if ( "\x1f\x8b\x08" === substr( $gz_data, 0, 3 ) ) {
    107107                        $i   = 10;
    108                         $flg = ord( substr( $gzData, 3, 1 ) );
     108                        $flg = ord( substr( $gz_data, 3, 1 ) );
    109109                        if ( $flg > 0 ) {
    110110                                if ( $flg & 4 ) {
    111                                         list($xlen) = unpack( 'v', substr( $gzData, $i, 2 ) );
     111                                        list($xlen) = unpack( 'v', substr( $gz_data, $i, 2 ) );
    112112                                        $i          = $i + 2 + $xlen;
    113113                                }
    114114                                if ( $flg & 8 ) {
    115                                         $i = strpos( $gzData, "\0", $i ) + 1;
     115                                        $i = strpos( $gz_data, "\0", $i ) + 1;
    116116                                }
    117117                                if ( $flg & 16 ) {
    118                                         $i = strpos( $gzData, "\0", $i ) + 1;
     118                                        $i = strpos( $gz_data, "\0", $i ) + 1;
    119119                                }
    120120                                if ( $flg & 2 ) {
     
    122122                                }
    123123                        }
    124                         $decompressed = @gzinflate( substr( $gzData, $i, -8 ) );
     124                        $decompressed = @gzinflate( substr( $gz_data, $i, -8 ) );
    125125                        if ( false !== $decompressed ) {
    126126                                return $decompressed;
     
    129129
    130130                // Compressed data from java.util.zip.Deflater amongst others.
    131                 $decompressed = @gzinflate( substr( $gzData, 2 ) );
     131                $decompressed = @gzinflate( substr( $gz_data, 2 ) );
    132132                if ( false !== $decompressed ) {
    133133                        return $decompressed;
Note: See TracChangeset for help on using the changeset viewer.