WordPress.org

Make WordPress Core

Ticket #17416: 17416.diff

File 17416.diff, 1.1 KB (added by aaroncampbell, 7 years ago)

Also removes useless $raw_response var

  • wp-admin/includes/dashboard.php

     
    12081208                        'user-agent'    => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
    12091209                );
    12101210
    1211                 $raw_response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
     1211                $response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
    12121212
    1213                 if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] )
    1214                         return;
     1213                if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
     1214                        return false;
    12151215
    12161216                /**
    12171217                 * Response should be an array with:
     
    12241224                 *  'img_src' - string - An image representing the browser
    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 )
    12301230                        return;