From f72dc8ca54857bfcdd0838ec1bcfec0dd048bae2 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 30 Oct 2020 17:50:25 +0000 Subject: [PATCH] Upgrade/Install: During the install process, add additional checking for exising tables. If reinstalling WordPress, there is a condition where tables would exist in the database. Ensures that when that is the case, the install process can carry along without issue. Fixes #51676. Props xknown, garubi, mukesh27, desrosj, johnbillion, metalandcoffee, davidbaumwald, whyisjake. git-svn-id: https://develop.svn.wordpress.org/trunk@49452 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 3d0412630e..5c44f37e8a 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -1757,7 +1757,10 @@ function is_blog_installed() { } $described_table = $wpdb->get_results( "DESCRIBE $table;" ); - if ( is_array( $described_table ) && count( $described_table ) === 0 ) { + if ( + ( ! $described_table && empty( $wpdb->last_error ) ) || + ( is_array( $described_table ) && 0 === count( $described_table ) ) + ) { continue; }