Core Updates: Switch to using a new 1.7 version check API which will return extra auto-update packages when requested over SSL. The new API has switched to returning JSON. See #22704

Built from https://develop.svn.wordpress.org/trunk@25219


git-svn-id: http://core.svn.wordpress.org/trunk@25190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2013-09-03 03:22:10 +00:00
parent 145809b457
commit 88702eba45
2 changed files with 10 additions and 3 deletions

View File

@ -25,6 +25,10 @@ function list_core_update( $update ) {
global $wp_local_package, $wpdb;
static $first_pass = true;
// Don't show auto-updates in the updates page
if ( isset( $update->response ) && 'autoupdate' == $update->response )
return;
$version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
$update->current : sprintf("%s&ndash;<strong>%s</strong>", $update->current, $update->locale);
$current = false;

View File

@ -75,7 +75,10 @@ function wp_version_check() {
'multisite_enabled' => $multisite_enabled
);
$url = 'http://api.wordpress.org/core/version-check/1.6/?' . http_build_query( $query, null, '&' );
$url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
if ( wp_http_supports( 'ssl' ) )
$url = set_url_scheme( $url, 'https' );
$options = array(
'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ),
@ -92,7 +95,7 @@ function wp_version_check() {
return false;
$body = trim( wp_remote_retrieve_body( $response ) );
$body = maybe_unserialize( $body );
$body = json_decode( $body, true );
if ( ! is_array( $body ) || ! isset( $body['offers'] ) )
return false;
@ -110,7 +113,7 @@ function wp_version_check() {
$offer[ $offer_key ] = esc_html( $value );
}
$offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale',
'packages', 'current', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) );
'packages', 'current', 'version', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) );
}
$updates = new stdClass();