WP_HTTP: Prevent the 'max_body_length' and 'stream_handle' properties of the curl class from leaking between requests by specifically initializing them in every case. See #23472 & r23605

git-svn-id: https://develop.svn.wordpress.org/trunk@23609 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-03-04 05:40:43 +00:00
parent c267aa97a8
commit 5c1c214b26
1 changed files with 4 additions and 0 deletions

View File

@ -1175,6 +1175,8 @@ class WP_Http_Curl {
if ( isset( $r['limit-response-size'] ) )
$this->max_body_length = intval( $r['limit-response-size'] );
else
$this->max_body_length = false;
// If streaming to a file open a file handle, and setup our curl streaming handler
if ( $r['stream'] ) {
@ -1184,6 +1186,8 @@ class WP_Http_Curl {
$this->stream_handle = fopen( $r['filename'], 'w+' );
if ( ! $this->stream_handle )
return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
} else {
$this->stream_handle = false;
}
if ( !empty( $r['headers'] ) ) {