Avoid a fatal error in WP_Http::request() if $response is a WP_Error instance. props dllh, nacin. fixes #24987.

Built from https://develop.svn.wordpress.org/trunk@25114


git-svn-id: http://core.svn.wordpress.org/trunk@25095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-08-24 03:11:10 +00:00
parent fdef243bf6
commit db2a73a3f7

View File

@ -196,6 +196,8 @@ class WP_Http {
} }
$response = $this->_dispatch_request( $url, $r ); $response = $this->_dispatch_request( $url, $r );
if ( is_wp_error( $response ) )
return $response;
// Append cookies that were used in this request to the response // Append cookies that were used in this request to the response
if ( ! empty( $r['cookies'] ) ) { if ( ! empty( $r['cookies'] ) ) {