Skip to content

Commit

Permalink
Coding Standards: Rename the $arrHeaders variable to `$processed_he…
Browse files Browse the repository at this point in the history
…aders` in `WP_Http_Streams::request()`.

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

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

See #53359.

git-svn-id: https://develop.svn.wordpress.org/trunk@51929 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Oct 24, 2021
1 parent a1a11d6 commit e6ba58c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/wp-includes/class-wp-http-streams.php
Expand Up @@ -316,14 +316,14 @@ public function request( $url, $args = array() ) {

fclose( $handle );

$arrHeaders = WP_Http::processHeaders( $process['headers'], $url );
$processed_headers = WP_Http::processHeaders( $process['headers'], $url );

$response = array(
'headers' => $arrHeaders['headers'],
'headers' => $processed_headers['headers'],
// Not yet processed.
'body' => null,
'response' => $arrHeaders['response'],
'cookies' => $arrHeaders['cookies'],
'response' => $processed_headers['response'],
'cookies' => $processed_headers['cookies'],
'filename' => $parsed_args['filename'],
);

Expand All @@ -334,13 +334,13 @@ public function request( $url, $args = array() ) {
}

// If the body was chunk encoded, then decode it.
if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] )
&& 'chunked' === $arrHeaders['headers']['transfer-encoding']
if ( ! empty( $process['body'] ) && isset( $processed_headers['headers']['transfer-encoding'] )
&& 'chunked' === $processed_headers['headers']['transfer-encoding']
) {
$process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
}

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

Expand Down

0 comments on commit e6ba58c

Please sign in to comment.