Make WordPress Core

Changeset 25442


Ignore:
Timestamp:
09/14/2013 07:57:27 PM (11 years ago)
Author:
nacin
Message:

Move to JSON for the plugin and theme update-check API endpoints. see #25311.

File:
1 edited

Legend:

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

    r25421 r25442  
    207207    );
    208208
    209     $url = 'http://api.wordpress.org/plugins/update-check/1.0/';
     209    $url = 'http://api.wordpress.org/plugins/update-check/1.1/';
    210210    if ( wp_http_supports( array( 'ssl' ) ) )
    211211        $url = set_url_scheme( $url, 'https' );
     
    216216        return false;
    217217
    218     $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
    219 
    220     if ( is_array( $response ) )
    221         $new_option->response = $response;
     218    $response = json_decode( wp_remote_retrieve_body( $raw_response ) );
     219
     220    if ( is_object( $response ) )
     221        $new_option->response = (array) $response;
    222222    else
    223223        $new_option->response = array();
     
    318318    );
    319319
    320     $url = 'http://api.wordpress.org/themes/update-check/1.0/';
     320    $url = 'http://api.wordpress.org/themes/update-check/1.1/';
    321321    if ( wp_http_supports( array( 'ssl' ) ) )
    322322        $url = set_url_scheme( $url, 'https' );
     
    331331    $new_update->checked = $checked;
    332332
    333     $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     333    $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
    334334    if ( is_array( $response ) )
    335335        $new_update->response = $response;
Note: See TracChangeset for help on using the changeset viewer.