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.
Built from https://develop.svn.wordpress.org/trunk@52962


git-svn-id: http://core.svn.wordpress.org/trunk@52551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-03-20 15:50:06 +00:00
parent 236e1d4ee3
commit 6c3ea94f97
2 changed files with 11 additions and 11 deletions

View File

@ -211,7 +211,7 @@ class WP_Http_Streams {
$request_path = $parsed_url['path'] . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' ); $request_path = $parsed_url['path'] . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' );
} }
$strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n"; $headers = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
$include_port_in_host_header = ( $include_port_in_host_header = (
( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
@ -220,34 +220,34 @@ class WP_Http_Streams {
); );
if ( $include_port_in_host_header ) { if ( $include_port_in_host_header ) {
$strHeaders .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n"; $headers .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n";
} else { } else {
$strHeaders .= 'Host: ' . $parsed_url['host'] . "\r\n"; $headers .= 'Host: ' . $parsed_url['host'] . "\r\n";
} }
if ( isset( $parsed_args['user-agent'] ) ) { if ( isset( $parsed_args['user-agent'] ) ) {
$strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n"; $headers .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
} }
if ( is_array( $parsed_args['headers'] ) ) { if ( is_array( $parsed_args['headers'] ) ) {
foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) { foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
$strHeaders .= $header . ': ' . $headerValue . "\r\n"; $headers .= $header . ': ' . $headerValue . "\r\n";
} }
} else { } else {
$strHeaders .= $parsed_args['headers']; $headers .= $parsed_args['headers'];
} }
if ( $proxy->use_authentication() ) { if ( $proxy->use_authentication() ) {
$strHeaders .= $proxy->authentication_header() . "\r\n"; $headers .= $proxy->authentication_header() . "\r\n";
} }
$strHeaders .= "\r\n"; $headers .= "\r\n";
if ( ! is_null( $parsed_args['body'] ) ) { if ( ! is_null( $parsed_args['body'] ) ) {
$strHeaders .= $parsed_args['body']; $headers .= $parsed_args['body'];
} }
fwrite( $handle, $strHeaders ); fwrite( $handle, $headers );
if ( ! $parsed_args['blocking'] ) { if ( ! $parsed_args['blocking'] ) {
stream_set_blocking( $handle, 0 ); stream_set_blocking( $handle, 0 );

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.0-alpha-52961'; $wp_version = '6.0-alpha-52962';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.