Make WordPress Core

Changeset 37436


Ignore:
Timestamp:
05/16/2016 06:11:58 AM (8 years ago)
Author:
rmccue
Message:

HTTP API: Pass array-like object to http_api_debug.

This was mistakingly passing the Requests_Response object, which caused fatal errors with debugging tools.

See #33055.

File:
1 edited

Legend:

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

    r37429 r37436  
    350350        try {
    351351            $response = Requests::request( $url, $headers, $data, $type, $options );
     352
     353            // Convert the response into an array
     354            $response = new WP_HTTP_Requests_Response( $response, $r['filename'] );
    352355        }
    353356        catch ( Requests_Exception $e ) {
     
    383386        }
    384387
    385         // Convert the response into an array
    386         $data = new WP_HTTP_Requests_Response( $response, $r['filename'] );
    387 
    388388        /**
    389389         * Filter the HTTP API response immediately before the response is returned.
     
    391391         * @since 2.9.0
    392392         *
    393          * @param array  $data HTTP response.
    394          * @param array  $r    HTTP request arguments.
    395          * @param string $url  The request URL.
     393         * @param array  $response HTTP response.
     394         * @param array  $r        HTTP request arguments.
     395         * @param string $url      The request URL.
    396396         */
    397         return apply_filters( 'http_response', $data, $r, $url );
     397        return apply_filters( 'http_response', $response, $r, $url );
    398398    }
    399399
Note: See TracChangeset for help on using the changeset viewer.