WordPress.org

Make WordPress Core

Ticket #11464: 11464.5.diff

File 11464.5.diff, 1.2 KB (added by Denis-de-Bernardy, 4 years ago)

fix the typo as well

  • wp-admin/includes/update-core.php

     
    215215 * @return WP_Error|null WP_Error on failure, null on success. 
    216216 */ 
    217217function update_core($from, $to) { 
    218         global $wp_filesystem, $_old_files; 
     218        global $wp_filesystem, $_old_files, $wpdb; 
    219219 
    220220        @set_time_limit( 300 ); 
    221221 
     222        //Check for required PHP and MYSQL versions 
     223        $mysql_version = $wpdb->db_version(); 
     224        $php_version = phpversion(); 
     225        if ( ( version_compare($mysql_version, '4.1.2', '<') && !file_exists( WP_CONTENT_DIR . '/db.php' ) ) || version_compare($php_version, '4.3', '<') ) { 
     226                return new WP_Error('not_compatible', sprintf(__('The update cannot be installed 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) ); 
     227        } 
     228         
    222229        // Sanity check the unzipped distribution 
    223230        apply_filters('update_feedback', __('Verifying the unpacked files')); 
    224231        if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') ||