WordPress.org

Make WordPress Core

Changeset 18227


Ignore:
Timestamp:
06/10/11 06:22:33 (4 years ago)
Author:
nacin
Message:

Extra check for partial updates: Make sure the API response matches the current version of WP. see #10611.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r18225 r18227  
    868868 
    869869    function upgrade($current) { 
    870         global $wp_filesystem; 
     870        global $wp_filesystem, $wp_version; 
    871871 
    872872        $this->init(); 
     
    890890        // Don't though if the constant is set to skip bundled items. 
    891891        // If the API returns a no_content zip, go with it. Finally, default to the full zip. 
    892         if ( $current->packages->partial && 'reinstall' != $current->response ) 
     892        if ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version ) 
    893893            $to_download = 'partial'; 
    894894        elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' ) 
  • trunk/wp-includes/update.php

    r18226 r18227  
    9292                $offer[ $offer_key ] = esc_html( $value ); 
    9393        } 
    94         $offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 
    95             'locale', 'packages', 'current', 'php_version', 'mysql_version', 'new_bundled' ), '' ) ); 
     94        $offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale', 
     95            'packages', 'current', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) ); 
    9696    } 
    9797 
Note: See TracChangeset for help on using the changeset viewer.