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
This commit is contained in:
Ryan Boren 2009-12-18 16:53:44 +00:00
parent b5d35e68ec
commit 715fa5d163
1 changed files with 11 additions and 9 deletions

View File

@ -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