Skip to content

Commit

Permalink
Coding Standards: Rename $theHeaders variable to `$processed_header…
Browse files Browse the repository at this point in the history
…s` in `WP_Http_Curl::request()`.

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

Follow-up to [8516], [8520], [51826], [51929].

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51931 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Oct 25, 2021
1 parent 2238c30 commit aa37d5b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/wp-includes/class-wp-http-curl.php
Expand Up @@ -256,7 +256,8 @@ public function request( $url, $args = array() ) {
}

curl_exec( $handle );
$theHeaders = WP_Http::processHeaders( $this->headers, $url );

$processed_headers = WP_Http::processHeaders( $this->headers, $url );
$theBody = $this->body;
$bytes_written_total = $this->bytes_written_total;

Expand All @@ -267,7 +268,7 @@ public function request( $url, $args = array() ) {
$curl_error = curl_errno( $handle );

// If an error occurred, or, no response.
if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $processed_headers['headers'] ) ) ) {
if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {
if ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {
if ( $parsed_args['stream'] ) {
Expand Down Expand Up @@ -299,10 +300,10 @@ public function request( $url, $args = array() ) {
}

$response = array(
'headers' => $theHeaders['headers'],
'headers' => $processed_headers['headers'],
'body' => null,
'response' => $theHeaders['response'],
'cookies' => $theHeaders['cookies'],
'response' => $processed_headers['response'],
'cookies' => $processed_headers['cookies'],
'filename' => $parsed_args['filename'],
);

Expand All @@ -312,7 +313,9 @@ public function request( $url, $args = array() ) {
return $redirect_response;
}

if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
if ( true === $parsed_args['decompress']
&& true === WP_Http_Encoding::should_decode( $processed_headers['headers'] )
) {
$theBody = WP_Http_Encoding::decompress( $theBody );
}

Expand Down

0 comments on commit aa37d5b

Please sign in to comment.