WordPress.org

Make WordPress Core

Ticket #51011: 51011.diff

File 51011.diff, 549 bytes (added by fjarrett, 14 months ago)

Use null for strict comparison of home option value

  • wp-admin/includes/upgrade.php

    diff --git wp-admin/includes/upgrade.php wp-admin/includes/upgrade.php
    index 8cc106f45d..0bc556a2db 100644
    function __get_option( $setting ) { // phpcs:ignore WordPress.NamingConventions. 
    25672567
    25682568        $option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) );
    25692569
    2570         if ( 'home' === $setting && '' === $option ) {
     2570        if ( 'home' === $setting && null === $option ) {
    25712571                return __get_option( 'siteurl' );
    25722572        }
    25732573