WordPress.org

Make WordPress Core

Ticket #16758: 16758.patch

File 16758.patch, 1.7 KB (added by hakre, 7 years ago)
  • wp-admin/includes/upgrade.php

     
    18311831 * @since 2.1.0
    18321832 */
    18331833function wp_check_mysql_version() {
    1834         global $wpdb;
    1835         $result = $wpdb->check_database_version();
    1836         if ( is_wp_error( $result ) )
     1834        global $wpdb, $wp_version, $required_mysql_version;
     1835        // Make sure the server has the required MySQL version
     1836        if ( version_compare($wpdb->db_version(), $required_mysql_version, '<') ) {
     1837                $result = new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
    18371838                die( $result->get_error_message() );
     1839        }
    18381840}
    18391841
    18401842/**
  • wp-includes/wp-db.php

     
    14861486        }
    14871487
    14881488        /**
    1489          * Whether MySQL database is at least the required minimum version.
    1490          *
    1491          * @since 2.5.0
    1492          * @uses $wp_version
    1493          * @uses $required_mysql_version
    1494          *
    1495          * @return WP_Error
    1496          */
    1497         function check_database_version() {
    1498                 global $wp_version, $required_mysql_version;
    1499                 // Make sure the server has the required MySQL version
    1500                 if ( version_compare($this->db_version(), $required_mysql_version, '<') )
    1501                         return new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
    1502         }
    1503 
    1504         /**
    15051489         * Whether the database supports collation.
    15061490         *
    15071491         * Called when WordPress is generating the table scheme.