WordPress.org

Make WordPress Core

Changeset 20370


Ignore:
Timestamp:
04/05/12 11:58:04 (2 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-http.php

    r20208 r20370  
    11111111 
    11121112        // If no response 
    1113         if ( 0 == strlen($theResponse) && empty( $theHeaders ) ) { 
    1114             if ( $curl_error = curl_error($handle) ) 
    1115                 return new WP_Error('http_request_failed', $curl_error); 
    1116             if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) ) 
    1117                 return new WP_Error('http_request_failed', __('Too many redirects.')); 
     1113        if ( 0 == strlen( $theResponse ) && empty( $theHeaders->headers ) ) { 
     1114            if ( $curl_error = curl_error( $handle ) ) 
     1115                return new WP_Error( 'http_request_failed', $curl_error ); 
     1116            if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) 
     1117                return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) ); 
    11181118        } 
    11191119 
Note: See TracChangeset for help on using the changeset viewer.