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

git-svn-id: http://svn.automattic.com/wordpress/trunk@18227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-06-10 06:22:33 +00:00
parent 75cfc9afc1
commit bf9c99e1fa
2 changed files with 4 additions and 4 deletions

View File

@ -867,7 +867,7 @@ class Core_Upgrader extends WP_Upgrader {
}
function upgrade($current) {
global $wp_filesystem;
global $wp_filesystem, $wp_version;
$this->init();
$this->upgrade_strings();
@ -889,7 +889,7 @@ class Core_Upgrader extends WP_Upgrader {
// If we cross the new_bundled version number, then use the new_bundled zip.
// Don't though if the constant is set to skip bundled items.
// If the API returns a no_content zip, go with it. Finally, default to the full zip.
if ( $current->packages->partial && 'reinstall' != $current->response )
if ( $current->packages->partial && 'reinstall' != $current->response && $wp_version == $current->partial_version )
$to_download = 'partial';
elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )
&& ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) )

View File

@ -91,8 +91,8 @@ function wp_version_check() {
else
$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' ), '' ) );
$offer = (object) array_intersect_key( $offer, array_fill_keys( array( 'response', 'download', 'locale',
'packages', 'current', 'php_version', 'mysql_version', 'new_bundled', 'partial_version' ), '' ) );
}
$updates = new stdClass();