Ticket #23463: 23463.diff
File 23463.diff, 1.0 KB (added by , 12 years ago) |
---|
-
wp-includes/class-http.php
163 164 unset( $r['headers']['user-agent'] ); 164 165 } 165 166 167 if ( '1.1' == $r['httpversion'] ) { 168 $r['headers']['connection'] = 'close'; 169 } 170 166 171 // Construct Cookie: header if any cookies are set 167 172 WP_Http::buildCookieHeader( $r ); 168 173 … … 449 454 450 455 if ( $hasChunk ) { 451 456 if ( empty( $match[1] ) ) 452 return $ body;457 return $parsedBody ? $parsedBody : $body; 453 458 454 459 $length = hexdec( $match[1] ); 455 460 $chunkLength = strlen( $match[0] ); 456 457 461 $strBody = substr($body, $chunkLength, $length); 458 462 $parsedBody .= $strBody; 459 463 460 $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n");464 $body = substr( $body, $length + $chunkLength ); 461 465 462 466 if ( "0" == trim($body) ) 463 467 return $parsedBody; // Ignore footer headers. 464 468 } else { 465 return $ body;469 return $parsedBody ? $parsedBody : $body; 466 470 } 467 471 } 468 472 }