From 715fa5d16371fa3ff4b31278d696c9c570deaeed Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 18 Dec 2009 16:53:44 +0000 Subject: [PATCH] Hard code required version in update-core.php. see #11464 git-svn-id: https://develop.svn.wordpress.org/trunk@12450 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update-core.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 0da88ca0ad..167b5bc139 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -219,17 +219,11 @@ function update_core($from, $to) { @set_time_limit( 300 ); - // Sanity check the unzipped distribution - apply_filters('update_feedback', __('Verifying the unpacked files')); - if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || - !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { - $wp_filesystem->delete($from, true); - return new WP_Error('insane_distro', __('The update could not be unpacked') ); - } - - include( $from . '/wordpress/wp-includes/version.php' ); $php_version = phpversion(); $mysql_version = $wpdb->db_version(); + $required_php_version = '4.3'; + $required_mysql_version = '4.1.2'; + $wp_version = '2.9'; $php_compat = version_compare( $php_version, $required_php_version, '>=' ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); @@ -240,6 +234,14 @@ function update_core($from, $to) { elseif ( !$mysql_compat ) return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); + // Sanity check the unzipped distribution + apply_filters('update_feedback', __('Verifying the unpacked files')); + if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || + !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { + $wp_filesystem->delete($from, true); + return new WP_Error('insane_distro', __('The update could not be unpacked') ); + } + apply_filters('update_feedback', __('Installing the latest version')); // Create maintenance file to signal that we are upgrading