Make WordPress Core

Ticket #26969: 26969.diff

File 26969.diff, 1.0 KB (added by Denis-de-Bernardy, 11 years ago)
  • wp-admin/includes/schema.php

    diff --git wp-admin/includes/schema.php wp-admin/includes/schema.php
    index 90ab600..2c29290 100644
    function populate_options() { 
    330330        global $wpdb, $wp_db_version, $wp_current_db_version;
    331331
    332332        $guessurl = wp_guess_url();
     333        // If no wp-config.php file exists in ABSPATH, but does in the parent folder
     334        // alongside an index.php file, assume WP is installed in that folder,
     335        if (!file_exists(ABSPATH . 'wp-config.php')
     336                && file_exists(ABSPATH . '../index.php'
     337                && file_exists(ABSPATH . '../wp-config.php')
     338        ) {
     339        $guess_home_url = dirname($guessurl);
     340        } else {
     341                $guess_home_url = $guessurl;
     342        }
     343
    333344        /**
    334345         * Fires before creating WordPress options and populating their default values.
    335346         *
    function populate_options() { 
    403414        'blog_charset' => 'UTF-8',
    404415        'moderation_keys' => '',
    405416        'active_plugins' => array(),
    406         'home' => $guessurl,
     417        'home' => $guess_home_url,
    407418        'category_base' => '',
    408419        'ping_sites' => 'http://rpc.pingomatic.com/',
    409420        'advanced_edit' => 0,