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: https://develop.svn.wordpress.org/trunk@21924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-09-20 13:39:46 +00:00
parent 588886c634
commit 097c2c0e90

View File

@ -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( __( '<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>' ) . '</body></html>' );
$wpdb->suppress_errors( false );
$url = get_blogaddress_by_id( $blog_id );