Avoid a fatal error in WP_Http::request() if $response is a WP_Error instance. props dllh, nacin. fixes #24987.
git-svn-id: https://develop.svn.wordpress.org/trunk@25114 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
086c5a8ab8
commit
d2a1a80683
|
@ -195,7 +195,9 @@ class WP_Http {
|
|||
$r['headers']['Content-Length'] = strlen( $r['body'] );
|
||||
}
|
||||
|
||||
$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
|
||||
if ( ! empty( $r['cookies'] ) ) {
|
||||
|
|
Loading…
Reference in New Issue