| 1 | Index: wp-admin/includes/update-core.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-admin/includes/update-core.php (revision 12413) |
|---|
| 4 | +++ wp-admin/includes/update-core.php (working copy) |
|---|
| 5 | @@ -215,10 +215,17 @@ |
|---|
| 6 | * @return WP_Error|null WP_Error on failure, null on success. |
|---|
| 7 | */ |
|---|
| 8 | function update_core($from, $to) { |
|---|
| 9 | - global $wp_filesystem, $_old_files; |
|---|
| 10 | + global $wp_filesystem, $_old_files, $wpdb; |
|---|
| 11 | |
|---|
| 12 | @set_time_limit( 300 ); |
|---|
| 13 | |
|---|
| 14 | + //Check for required PHP and MYSQL versions |
|---|
| 15 | + $mysql_version = $wpdb->db_version(); |
|---|
| 16 | + $php_version = phpversion(); |
|---|
| 17 | + if ( ( version_compare($mysql_version, '4.1.2', '<') && !file_exists( WP_CONTENT_DIR . '/db.php' ) ) || version_compare($php_version, '4.3', '<') ) { |
|---|
| 18 | + return new WP_Error('not_compatible', sprintf(__('The update cannot be install because you do not have the correct PHP (%1$s vs 4.3 or newer) and mysql versions (%2$s vs 4.1.2 or newer).'), $mysql_version, $php_version) ); |
|---|
| 19 | + } |
|---|
| 20 | + |
|---|
| 21 | // Sanity check the unzipped distribution |
|---|
| 22 | apply_filters('update_feedback', __('Verifying the unpacked files')); |
|---|
| 23 | if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || |
|---|