Make WordPress Core

Changeset 17692


Ignore:
Timestamp:
04/23/2011 01:49:52 PM (15 years ago)
Author:
dd32
Message:

Allow the cURL transport to handle '0' response bodies. Fixes #17223

File:
1 edited

Legend:

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

    r17659 r17692  
    10921092                $theHeaders = WP_Http::processHeaders( $this->headers );
    10931093
    1094                 if ( ! empty($theResponse) && ! is_bool( $theResponse ) ) // is_bool: when using $args['stream'], curl_exec will return (bool)true
     1094                if ( strlen($theResponse) > 0 && ! is_bool( $theResponse ) ) // is_bool: when using $args['stream'], curl_exec will return (bool)true
    10951095                        $theBody = $theResponse;
    10961096
    10971097                // If no response, and It's not a HEAD request with valid headers returned
    1098                 if ( empty($theResponse) && ('HEAD' != $args['method'] || empty($this->headers)) ) {
     1098                if ( 0 == strlen($theResponse) && ('HEAD' != $args['method'] || empty($this->headers)) ) {
    10991099                        if ( $curl_error = curl_error($handle) )
    11001100                                return new WP_Error('http_request_failed', $curl_error);
Note: See TracChangeset for help on using the changeset viewer.