From 594508b339679b5ddbc284005ec2518b7a96bcfa Mon Sep 17 00:00:00 2001 From: whyisjake Date: Fri, 30 Oct 2020 18:33:53 +0000 Subject: [PATCH] Upgrade/Install: During the install process, add additional checking for exising tables. This commit brings the changes in [49452] to the 5.1 branch. If reinstalling WordPress, there is a condition where tables would exist in the database. Ensures that$ Fixes #51676. Props xknown, garubi, mukesh27, desrosj, johnbillion, metalandcoffee, davidbaumwald, whyisjake. Built from https://develop.svn.wordpress.org/branches/5.1@49457 git-svn-id: http://core.svn.wordpress.org/branches/5.1@49216 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 3d0eac990d..ea10caa4ef 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1567,7 +1567,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; }