From bf9c99e1fadf493dd6ee84f9ab85e3f5eff3d05f Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 10 Jun 2011 06:22:33 +0000 Subject: [PATCH] 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 --- wp-admin/includes/class-wp-upgrader.php | 4 ++-- wp-includes/update.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 04819fbf2..1cf4c41c2 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -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 ) ) diff --git a/wp-includes/update.php b/wp-includes/update.php index e4fa83c37..65843271b 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -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();