Make WordPress Core

Changeset 52960


Ignore:
Timestamp:
03/20/2022 03:35:13 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename the $bodyStarted variable to $body_started 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-streams.php

    r52680 r52960  
    265265
    266266        $strResponse  = '';
    267         $bodyStarted = false;
     267        $body_started = false;
    268268        $keep_reading = true;
    269269        $block_size   = 4096;
     
    297297            while ( ! feof( $handle ) && $keep_reading ) {
    298298                $block = fread( $handle, $block_size );
    299                 if ( ! $bodyStarted ) {
     299                if ( ! $body_started ) {
    300300                    $strResponse .= $block;
    301301                    if ( strpos( $strResponse, "\r\n\r\n" ) ) {
    302302                        $processed_response = WP_Http::processResponse( $strResponse );
    303                         $bodyStarted        = true;
     303                        $body_started       = true;
    304304                        $block              = $processed_response['body'];
    305305                        unset( $strResponse );
     
    342342                $strResponse .= $block;
    343343
    344                 if ( ! $bodyStarted && strpos( $strResponse, "\r\n\r\n" ) ) {
     344                if ( ! $body_started && strpos( $strResponse, "\r\n\r\n" ) ) {
    345345                    $header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
    346                     $bodyStarted   = true;
     346                    $body_started  = true;
    347347                }
    348348
    349349                $keep_reading = (
    350                     ! $bodyStarted
     350                    ! $body_started
    351351                    || ! isset( $parsed_args['limit_response_size'] )
    352352                    || strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] )
Note: See TracChangeset for help on using the changeset viewer.