From 1513f1daea2e2f1c7cb5fd052bf95ba1f119bb55 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 20 Sep 2012 13:39:46 +0000 Subject: [PATCH] Suppress db errors when checking if the blog is already installed in install_blog(). Use DESCRIBE instead of SELECT. Props bpetty. fixes #21922 git-svn-id: http://core.svn.wordpress.org/trunk@21924 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 6707c20383..04b4caabc0 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1127,8 +1127,10 @@ function install_blog($blog_id, $blog_title = '') { require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); - if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) + $wpdb->suppress_errors(); + if ( $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ) ) die( __( '

Already Installed

You appear to have already installed WordPress. To reinstall please clear your old database tables first.

' ) . '' ); + $wpdb->suppress_errors( false ); $url = get_blogaddress_by_id( $blog_id );