mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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: http://svn.automattic.com/wordpress/trunk@20370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
72c5403630
commit
c5b25fd6d0
@ -1110,11 +1110,11 @@ class WP_Http_Curl {
|
||||
$theBody = $theResponse;
|
||||
|
||||
// If no response
|
||||
if ( 0 == strlen($theResponse) && empty( $theHeaders ) ) {
|
||||
if ( $curl_error = curl_error($handle) )
|
||||
return new WP_Error('http_request_failed', $curl_error);
|
||||
if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) )
|
||||
return new WP_Error('http_request_failed', __('Too many redirects.'));
|
||||
if ( 0 == strlen( $theResponse ) && empty( $theHeaders->headers ) ) {
|
||||
if ( $curl_error = curl_error( $handle ) )
|
||||
return new WP_Error( 'http_request_failed', $curl_error );
|
||||
if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) )
|
||||
return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
|
||||
}
|
||||
|
||||
$this->headers = '';
|
||||
|
Loading…
Reference in New Issue
Block a user