Make WordPress Core


Ignore:
Timestamp:
08/08/2008 10:49:35 PM (18 years ago)
Author:
ryan
Message:

Automatic upgrade, first cut. see #5560

File:
1 edited

Legend:

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

    r8516 r8595  
    4141        $new_option->version_checked = $wp_version;
    4242
    43         $url = "http://api.wordpress.org/core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale";
     43        $url = "http://api.wordpress.org/core/version-check/1.2/?version=$wp_version&php=$php_version&locale=$locale";
    4444        $options = array('timeout' => 3);
    4545
     
    5151        $response = wp_remote_request($url, $options, $headers);
    5252
    53         if( 200 != $response['response']['code'] )
     53        if ( 200 != $response['response']['code'] )
    5454                return false;
    5555
    5656        $body = $response['body'];
    57 
    58         $body = trim( $response[1] );
     57        $body = trim( $body );
    5958        $body = str_replace(array("\r\n", "\r"), "\n", $body);
    60 
    6159        $returns = explode("\n", $body);
    6260
     
    6563                $new_option->url = clean_url( $returns[1] );
    6664        if ( isset( $returns[2] ) )
    67                 $new_option->current = attribute_escape( $returns[2] );
     65                $new_option->package = clean_url( $returns[2] );
     66        if ( isset( $returns[3] ) )
     67                $new_option->current = attribute_escape( $returns[3] );
     68        if ( isset( $returns[4] ) )
     69                $new_option->locale = attribute_escape( $returns[4] );
    6870
    6971        update_option( 'update_core', $new_option );
Note: See TracChangeset for help on using the changeset viewer.