From 9414d6e40e1e9e9f9a7cc9286bc0511ca0e24541 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 14 Sep 2013 19:58:09 +0000 Subject: [PATCH] Move to JSON for the plugin and theme update-check API endpoints. see #25311. Built from https://develop.svn.wordpress.org/trunk@25442 git-svn-id: http://core.svn.wordpress.org/trunk@25363 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/update.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/update.php b/wp-includes/update.php index 2123387bb4..476c87c280 100644 --- a/wp-includes/update.php +++ b/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;