Make WordPress Core


Ignore:
Timestamp:
05/13/2016 04:41:45 AM (9 years ago)
Author:
rmccue
Message:

HTTP API: Replace internals with Requests library.

Requests is a library very similar to WP_HTTP, with a high level of unit test coverage, and has a common lineage and development team. It also supports parallel requests.

See #33055.

File:
1 edited

Legend:

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

    r37115 r37428  
    214214 */
    215215function wp_remote_retrieve_headers( $response ) {
    216     if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers']))
     216    if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
    217217        return array();
     218    }
    218219
    219220    return $response['headers'];
     
    230231 */
    231232function wp_remote_retrieve_header( $response, $header ) {
    232     if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers']))
     233    if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
    233234        return '';
    234 
    235     if ( array_key_exists($header, $response['headers']) )
     235    }
     236
     237    if ( isset( $response['headers'][ $header ] ) ) {
    236238        return $response['headers'][$header];
     239    }
    237240
    238241    return '';
Note: See TracChangeset for help on using the changeset viewer.