WordPress.org

Make WordPress Core

Ticket #33909: 33909.3.diff

File 33909.3.diff, 919 bytes (added by fgirardey, 4 years ago)

Use rtrim on WP_HOME as wp_guess_url() does.

  • src/wp-admin/includes/schema.php

    diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
    index 4eb6bca..a69921c 100644
    $wp_queries = wp_get_db_schema( 'all' ); 
    344344function populate_options() {
    345345        global $wpdb, $wp_db_version, $wp_current_db_version;
    346346
    347         $guessurl = wp_guess_url();
     347    $guessurl = $homeurl = wp_guess_url();
     348    if ( defined( 'WP_HOME' ) && ! empty( WP_HOME ) ) { // wp_guess_url() checked WP_SITEURL constant.
     349        $homeurl = rtrim( WP_HOME, '/' );
     350    }
    348351        /**
    349352         * Fires before creating WordPress options and populating their default values.
    350353         *
    function populate_options() { 
    379382
    380383        $options = array(
    381384        'siteurl' => $guessurl,
    382         'home' => $guessurl,
     385        'home' => $homeurl,
    383386        'blogname' => __('My Site'),
    384387        /* translators: blog tagline */
    385388        'blogdescription' => __('Just another WordPress site'),