From f9f244b2d16aba8127649acaf1e88fee3fb45d5c Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 19 Jan 2007 09:28:02 +0000 Subject: [PATCH] Make sure the server has MySQL 4.0.0 before attempting upgrade or install. fixes #3615 git-svn-id: https://develop.svn.wordpress.org/trunk@4771 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/upgrade-functions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 17a24ad4d1..6d15788400 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -11,6 +11,7 @@ if ( !function_exists('wp_install') ) : function wp_install($blog_title, $user_name, $user_email, $public, $meta='') { global $wp_rewrite; + wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); populate_options(); @@ -134,6 +135,7 @@ function wp_upgrade() { if ( $wp_db_version == $wp_current_db_version ) return; + wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); upgrade_all(); @@ -1081,4 +1083,13 @@ function translate_level_to_role($level) { } } +function wp_check_mysql_version() { + global $wp_version; + + // Make sure the server has MySQL 4.0 + $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info()); + if ( version_compare($mysql_version, '4.0.0', '<') ) + die(sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); +} + ?>