From f15b11bc7ff0f0469fe630a6fc0f6cf80a9e20fe Mon Sep 17 00:00:00 2001 From: markjaquith 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: http://svn.automattic.com/wordpress/trunk@4771 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 17a24ad4d..6d1578840 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)); +} + ?>