Commit 6ce0801e authored by Sergey Biryukov's avatar Sergey Biryukov
Browse files

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.
Merges [48868] to the 5.5 branch.
Fixes #51011.
Built from https://develop.svn.wordpress.org/branches/5.5@48869


git-svn-id: https://core.svn.wordpress.org/branches/5.5@48631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent fd43bdd3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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' );
	}

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 * @global string $wp_version
 */
$wp_version = '5.5.1-alpha-48867';
$wp_version = '5.5.1-alpha-48869';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.