Changeset 10284
- Timestamp:
- 12/31/2008 03:03:26 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.7/wp-includes/http.php
r10212 r10284 392 392 * 393 393 * @param string $body Body content 394 * @return bool|string|WP_Error False if not chunked encoded. WP_Error on failure. Chunked decoded body on success.394 * @return string Chunked decoded body on success or raw body on failure. 395 395 */ 396 396 function chunkTransferDecode($body) { … … 403 403 //$parsedHeaders = array(); Unsupported 404 404 405 $done = false; 406 407 do { 405 while ( true ) { 408 406 $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); 409 407 410 408 if ( $hasChunk ) { 411 if ( empty($match[1]) ) { 412 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') ); 413 } 409 if ( empty($match[1]) ) 410 return $body; 414 411 415 412 $length = hexdec( $match[1] ); … … 421 418 $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); 422 419 423 if( "0" == trim($body) ) { 424 $done = true; 420 if( "0" == trim($body) ) 425 421 return $parsedBody; // Ignore footer headers. 426 break;427 }428 422 } else { 429 return new WP_Error('http_chunked_decode', __('Does not appear to be chunked encoded or body is malformed.') );423 return $body; 430 424 } 431 } while ( false === $done );425 } 432 426 } 433 427 }
Note: See TracChangeset
for help on using the changeset viewer.