Skip to content

Commit

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

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

Follow-up to [17555], [51825], [51929], [51940].

Props azouamauriac.
See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@52960 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Mar 20, 2022
1 parent 166860e commit aafc0ae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/wp-includes/class-wp-http-streams.php
Expand Up @@ -264,7 +264,7 @@ public function request( $url, $args = array() ) {
}

$strResponse = '';
$bodyStarted = false;
$body_started = false;
$keep_reading = true;
$block_size = 4096;

Expand Down Expand Up @@ -296,11 +296,11 @@ public function request( $url, $args = array() ) {

while ( ! feof( $handle ) && $keep_reading ) {
$block = fread( $handle, $block_size );
if ( ! $bodyStarted ) {
if ( ! $body_started ) {
$strResponse .= $block;
if ( strpos( $strResponse, "\r\n\r\n" ) ) {
$processed_response = WP_Http::processResponse( $strResponse );
$bodyStarted = true;
$body_started = true;
$block = $processed_response['body'];
unset( $strResponse );
$processed_response['body'] = '';
Expand Down Expand Up @@ -341,13 +341,13 @@ public function request( $url, $args = array() ) {
$block = fread( $handle, $block_size );
$strResponse .= $block;

if ( ! $bodyStarted && strpos( $strResponse, "\r\n\r\n" ) ) {
if ( ! $body_started && strpos( $strResponse, "\r\n\r\n" ) ) {
$header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
$bodyStarted = true;
$body_started = true;
}

$keep_reading = (
! $bodyStarted
! $body_started
|| ! isset( $parsed_args['limit_response_size'] )
|| strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] )
);
Expand Down

0 comments on commit aafc0ae

Please sign in to comment.