Changeset 52964
- Timestamp:
- 03/20/2022 04:01:01 PM (3 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-http-streams.php
r52963 r52964 264 264 } 265 265 266 $ strResponse= '';266 $response = ''; 267 267 $body_started = false; 268 268 $keep_reading = true; … … 298 298 $block = fread( $handle, $block_size ); 299 299 if ( ! $body_started ) { 300 $ strResponse .= $block;301 if ( strpos( $ strResponse, "\r\n\r\n" ) ) {302 $processed_response = WP_Http::processResponse( $ strResponse );300 $response .= $block; 301 if ( strpos( $response, "\r\n\r\n" ) ) { 302 $processed_response = WP_Http::processResponse( $response ); 303 303 $body_started = true; 304 304 $block = $processed_response['body']; 305 unset( $ strResponse );305 unset( $response ); 306 306 $processed_response['body'] = ''; 307 307 } … … 339 339 340 340 while ( ! feof( $handle ) && $keep_reading ) { 341 $block 342 $ strResponse .= $block;343 344 if ( ! $body_started && strpos( $ strResponse, "\r\n\r\n" ) ) {345 $header_length = strpos( $ strResponse, "\r\n\r\n" ) + 4;341 $block = fread( $handle, $block_size ); 342 $response .= $block; 343 344 if ( ! $body_started && strpos( $response, "\r\n\r\n" ) ) { 345 $header_length = strpos( $response, "\r\n\r\n" ) + 4; 346 346 $body_started = true; 347 347 } … … 350 350 ! $body_started 351 351 || ! isset( $parsed_args['limit_response_size'] ) 352 || strlen( $ strResponse ) < ( $header_length + $parsed_args['limit_response_size'] )353 ); 354 } 355 356 $processed_response = WP_Http::processResponse( $ strResponse );357 unset( $ strResponse );352 || strlen( $response ) < ( $header_length + $parsed_args['limit_response_size'] ) 353 ); 354 } 355 356 $processed_response = WP_Http::processResponse( $response ); 357 unset( $response ); 358 358 359 359 } -
trunk/src/wp-includes/class-wp-http.php
r52597 r52964 656 656 * @since 2.7.0 657 657 * 658 * @param string $ str_response The full response string.658 * @param string $response The full response string. 659 659 * @return array { 660 660 * Array with response headers and body. … … 664 664 * } 665 665 */ 666 public static function processResponse( $ str_response ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid667 $response = explode( "\r\n\r\n", $ str_response, 2 );666 public static function processResponse( $response ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid 667 $response = explode( "\r\n\r\n", $response, 2 ); 668 668 669 669 return array(
Note: See TracChangeset
for help on using the changeset viewer.