WP_HTTP: Curl: Correct a typo in [20208] causing failed curl requests not to return a WP_Error under certain situations. Props SergeyBiryukov. Fixes #20219
git-svn-id: https://develop.svn.wordpress.org/trunk@20370 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8578804f80
commit
20141db4eb
@ -1110,11 +1110,11 @@ class WP_Http_Curl {
|
|||||||
$theBody = $theResponse;
|
$theBody = $theResponse;
|
||||||
|
|
||||||
// If no response
|
// If no response
|
||||||
if ( 0 == strlen($theResponse) && empty( $theHeaders ) ) {
|
if ( 0 == strlen( $theResponse ) && empty( $theHeaders->headers ) ) {
|
||||||
if ( $curl_error = curl_error($handle) )
|
if ( $curl_error = curl_error( $handle ) )
|
||||||
return new WP_Error('http_request_failed', $curl_error);
|
return new WP_Error( 'http_request_failed', $curl_error );
|
||||||
if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) )
|
if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) )
|
||||||
return new WP_Error('http_request_failed', __('Too many redirects.'));
|
return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->headers = '';
|
$this->headers = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user