Skip to content

Commit

Permalink
Coding Standards: Rename the $theBody variable to $body in `WP_Ht…
Browse files Browse the repository at this point in the history
…tp_Curl::request()`.

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

Follow-up to [8516], [51825], [51929], [51931], [51940], [52025], [52960], [52961], [52962], [52963], [52964].

Props azouamauriac.
See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@52965 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Mar 20, 2022
1 parent 21327a2 commit a993557
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wp-includes/class-wp-http-curl.php
Expand Up @@ -258,7 +258,7 @@ public function request( $url, $args = array() ) {
curl_exec( $handle );

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

$this->headers = '';
Expand All @@ -268,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( $processed_headers['headers'] ) ) ) {
if ( $curl_error || ( 0 == strlen( $body ) && 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 @@ -316,10 +316,10 @@ public function request( $url, $args = array() ) {
if ( true === $parsed_args['decompress']
&& true === WP_Http_Encoding::should_decode( $processed_headers['headers'] )
) {
$theBody = WP_Http_Encoding::decompress( $theBody );
$body = WP_Http_Encoding::decompress( $body );
}

$response['body'] = $theBody;
$response['body'] = $body;

return $response;
}
Expand Down

0 comments on commit a993557

Please sign in to comment.