From 2db57edcadb22517c19dc6f83070fba6990ca37b Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 3 Mar 2010 07:27:18 +0000 Subject: [PATCH] Ignore custom user tables when checking whether the blog is installed. see #12083 git-svn-id: http://svn.automattic.com/wordpress/trunk@13569 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b7b010941..57488f2b3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1824,13 +1824,19 @@ function is_blog_installed() { $tables = $wpdb->get_col('SHOW TABLES'); $wpdb->suppress_errors( $suppress ); - $wp_tables = $wpdb->tables( 'all' ); + $wp_tables = $wpdb->tables(); // Loop over the WP tables. If none exist, then scratch install is allowed. // If one or more exist, suggest table repair since we got here because the options // table could not be accessed. foreach ( $wp_tables as $table ) { // If one of the WP tables exist, then we are in an insane state. if ( in_array( $table, $tables ) ) { + // The existence of custom user tables shouldn't suggest an insane state or prevent a clean install. + if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table ) + continue; + if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) + continue; + // If visiting repair.php, return true and let it take over. if ( defined('WP_REPAIRING') ) return true;