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
This commit is contained in:
nacin 2010-03-03 07:27:18 +00:00
parent 8b87777391
commit 2db57edcad
1 changed files with 7 additions and 1 deletions

View File

@ -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;