WordPress.org

Make WordPress Core

Ticket #30935: 30935.diff

File 30935.diff, 719 bytes (added by mattheweppelsheimer, 6 years ago)

explain check for wp-settings.php in parent before loading wp-config.php in parent

  • wp-load.php

    diff --git wp-load.php wp-load.php
    index 9021ceb..9861d0c 100644
    if ( file_exists( ABSPATH . 'wp-config.php') ) { 
    2828        /** The config file resides in ABSPATH */
    2929        require_once( ABSPATH . 'wp-config.php' );
    3030
     31/*
     32 * Only get wp-config.php from the parent directory
     33 * if wp-settings.php is not also in the parent directory.
     34 * Avoids cases where the current directory is a nested
     35 * installation, e.g. / is WordPressA and /blog/ is WordPressB.
     36 */
    3137} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-settings.php' ) ) {
    3238
    3339        /** The config file resides one level above ABSPATH but is not part of another install */