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:
parent
236e1d4ee3
commit
6c3ea94f97
|
@ -211,7 +211,7 @@ class WP_Http_Streams {
|
|||
$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 = (
|
||||
( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
|
||||
|
@ -220,34 +220,34 @@ class WP_Http_Streams {
|
|||
);
|
||||
|
||||
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 {
|
||||
$strHeaders .= 'Host: ' . $parsed_url['host'] . "\r\n";
|
||||
$headers .= 'Host: ' . $parsed_url['host'] . "\r\n";
|
||||
}
|
||||
|
||||
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'] ) ) {
|
||||
foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
|
||||
$strHeaders .= $header . ': ' . $headerValue . "\r\n";
|
||||
$headers .= $header . ': ' . $headerValue . "\r\n";
|
||||
}
|
||||
} else {
|
||||
$strHeaders .= $parsed_args['headers'];
|
||||
$headers .= $parsed_args['headers'];
|
||||
}
|
||||
|
||||
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'] ) ) {
|
||||
$strHeaders .= $parsed_args['body'];
|
||||
$headers .= $parsed_args['body'];
|
||||
}
|
||||
|
||||
fwrite( $handle, $strHeaders );
|
||||
fwrite( $handle, $headers );
|
||||
|
||||
if ( ! $parsed_args['blocking'] ) {
|
||||
stream_set_blocking( $handle, 0 );
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
Loading…
Reference in New Issue