From db7501f3fa9a484d0511348bbe92b72f3ced4f23 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 14 Sep 2013 19:57:27 +0000 Subject: [PATCH] Move to JSON for the plugin and theme update-check API endpoints. see #25311. git-svn-id: https://develop.svn.wordpress.org/trunk@25442 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/update.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index 2123387bb4..476c87c280 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -206,7 +206,7 @@ function wp_update_plugins() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); - $url = 'http://api.wordpress.org/plugins/update-check/1.0/'; + $url = 'http://api.wordpress.org/plugins/update-check/1.1/'; if ( wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' ); @@ -215,10 +215,10 @@ function wp_update_plugins() { if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) return false; - $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); + $response = json_decode( wp_remote_retrieve_body( $raw_response ) ); - if ( is_array( $response ) ) - $new_option->response = $response; + if ( is_object( $response ) ) + $new_option->response = (array) $response; else $new_option->response = array(); @@ -317,7 +317,7 @@ function wp_update_themes() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); - $url = 'http://api.wordpress.org/themes/update-check/1.0/'; + $url = 'http://api.wordpress.org/themes/update-check/1.1/'; if ( wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' ); @@ -330,7 +330,7 @@ function wp_update_themes() { $new_update->last_checked = time(); $new_update->checked = $checked; - $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); + $response = json_decode( wp_remote_retrieve_body( $raw_response ), true ); if ( is_array( $response ) ) $new_update->response = $response;