From c7f5af72dcc4f36365656fdbfccfa0fb51fefd1f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 26 Aug 2020 16:55:36 +0000 Subject: [PATCH] Upgrade/Install: Make the check for empty `home` option in `__get_option()` more resilient. This addresses a regression in [47808], where the `home` check expected an empty string to use `siteurl` as a fallback, but `wpdb::get_var()` returns `null` if the option is empty. Props fjarrett. Fixes #51011. git-svn-id: https://develop.svn.wordpress.org/trunk@48868 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 8cc106f45d..e0170f2705 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2567,7 +2567,7 @@ function __get_option( $setting ) { // phpcs:ignore WordPress.NamingConventions. $option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) ); - if ( 'home' === $setting && '' === $option ) { + if ( 'home' === $setting && ! $option ) { return __get_option( 'siteurl' ); }