mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Use wp_remote_retrieve_* helper functions instead of the raw HTTP response array. props aaroncampbell, fixes #17416.
git-svn-id: https://develop.svn.wordpress.org/trunk@17928 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1208,10 +1208,10 @@ function wp_check_browser_version() {
|
||||
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
||||
);
|
||||
|
||||
$raw_response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
|
||||
$response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.0/', $options );
|
||||
|
||||
if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] )
|
||||
return;
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||
return false;
|
||||
|
||||
/**
|
||||
* Response should be an array with:
|
||||
@@ -1224,7 +1224,7 @@ function wp_check_browser_version() {
|
||||
* 'img_src' - string - An image representing the browser
|
||||
* 'img_src_ssl' - string - An image (over SSL) representing the browser
|
||||
*/
|
||||
$response = unserialize( $raw_response['body'] );
|
||||
$response = unserialize( wp_remote_retrieve_body( $response ) );
|
||||
|
||||
if ( ! $response )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user