Make WordPress Core


Ignore:
Timestamp:
05/14/2011 07:45:07 PM (14 years ago)
Author:
nacin
Message:

Use wp_remote_retrieve_* helper functions instead of the raw HTTP response array. props aaroncampbell, fixes #17416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r17895 r17928  
    12091209        );
    12101210
    1211         $raw_response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
    1212 
    1213         if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] )
    1214             return;
     1211        $response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
     1212
     1213        if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
     1214            return false;
    12151215
    12161216        /**
     
    12251225         *  'img_src_ssl' - string - An image (over SSL) representing the browser
    12261226         */
    1227         $response = unserialize( $raw_response['body'] );
     1227        $response = unserialize( wp_remote_retrieve_body( $response ) );
    12281228
    12291229        if ( ! $response )
Note: See TracChangeset for help on using the changeset viewer.