WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/03/2013 03:21:59 AM (6 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/update.php

    r23265 r25219  
    7676    );
    7777
    78     $url = 'http://api.wordpress.org/core/version-check/1.6/?' . http_build_query( $query, null, '&' );
     78    $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
     79
     80    if ( wp_http_supports( 'ssl' ) )
     81        $url = set_url_scheme( $url, 'https' );
    7982
    8083    $options = array(
     
    9396
    9497    $body = trim( wp_remote_retrieve_body( $response ) );
    95     $body = maybe_unserialize( $body );
     98    $body = json_decode( $body, true );
    9699
    97100    if ( ! is_array( $body ) || ! isset( $body['offers'] ) )
     
    111114        }
    112115        $offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale',
    113             'packages', 'current', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) );
     116            'packages', 'current', 'version', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) );
    114117    }
    115118
Note: See TracChangeset for help on using the changeset viewer.