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:
parent
c267aa97a8
commit
5c1c214b26
|
@ -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'] ) ) {
|
||||
|
|
Loading…
Reference in New Issue