Make WordPress Core

Changeset 17563


Ignore:
Timestamp:
03/26/2011 03:32:05 AM (14 years ago)
Author:
dd32
Message:

Correct logic for cURL Errors, add extra sanity protection in ::processHeaders to guard against null inputs. See #16236

File:
1 edited

Legend:

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

    r17555 r17563  
    360360        $cookies = array();
    361361        $newheaders = array();
    362         foreach ( $headers as $tempheader ) {
     362        foreach ( (array) $headers as $tempheader ) {
    363363            if ( empty($tempheader) )
    364364                continue;
     
    11221122     * @var string
    11231123     */
    1124     private $headers;
     1124    private $headers = '';
    11251125
    11261126    /**
     
    12601260
    12611261        // If no response, and It's not a HEAD request with valid headers returned
    1262         if ( empty($theResponse) && 'HEAD' != $args['method'] && ! empty($this->headers) ) {
     1262        if ( empty($theResponse) && ('HEAD' != $args['method'] || empty($this->headers)) ) {
    12631263            if ( $curl_error = curl_error($handle) )
    12641264                return new WP_Error('http_request_failed', $curl_error);
Note: See TracChangeset for help on using the changeset viewer.