Make WordPress Core

Changeset 52962


Ignore:
Timestamp:
03/20/2022 03:48:26 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $strHeaders variable to $headers in WP_Http_Streams::request().

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

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961].

Props azouamauriac.
See #54728.

File:
1 edited

Legend:

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

    r52961 r52962  
    212212        }
    213213
    214         $strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
     214        $headers = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
    215215
    216216        $include_port_in_host_header = (
     
    221221
    222222        if ( $include_port_in_host_header ) {
    223             $strHeaders .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n";
     223            $headers .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n";
    224224        } else {
    225             $strHeaders .= 'Host: ' . $parsed_url['host'] . "\r\n";
     225            $headers .= 'Host: ' . $parsed_url['host'] . "\r\n";
    226226        }
    227227
    228228        if ( isset( $parsed_args['user-agent'] ) ) {
    229             $strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
     229            $headers .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
    230230        }
    231231
    232232        if ( is_array( $parsed_args['headers'] ) ) {
    233233            foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
    234                 $strHeaders .= $header . ': ' . $headerValue . "\r\n";
     234                $headers .= $header . ': ' . $headerValue . "\r\n";
    235235            }
    236236        } else {
    237             $strHeaders .= $parsed_args['headers'];
     237            $headers .= $parsed_args['headers'];
    238238        }
    239239
    240240        if ( $proxy->use_authentication() ) {
    241             $strHeaders .= $proxy->authentication_header() . "\r\n";
    242         }
    243 
    244         $strHeaders .= "\r\n";
     241            $headers .= $proxy->authentication_header() . "\r\n";
     242        }
     243
     244        $headers .= "\r\n";
    245245
    246246        if ( ! is_null( $parsed_args['body'] ) ) {
    247             $strHeaders .= $parsed_args['body'];
    248         }
    249 
    250         fwrite( $handle, $strHeaders );
     247            $headers .= $parsed_args['body'];
     248        }
     249
     250        fwrite( $handle, $headers );
    251251
    252252        if ( ! $parsed_args['blocking'] ) {
Note: See TracChangeset for help on using the changeset viewer.