From 5c1c214b26e75ec4a349dabfd6c3f554cc4010eb Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 4 Mar 2013 05:40:43 +0000 Subject: [PATCH] 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 --- wp-includes/class-http.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 5650b68df2..7512948ba6 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -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'] ) ) {