WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#30935 closed enhancement (fixed)

Explain check for ../wp-settings.php when getting ../wp-config.php

Reported by: mattheweppelsheimer Owned by: DrewAPicture
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Bootstrap/Load Keywords: has-patch
Focuses: docs Cc:

Description

In wp-load.php, when searching for wp-config.php in the parent directory, we abort if wp-settings.php is also in the parent directory. The reason isn't super clear.

Attachments (1)

30935.diff (719 bytes) - added by mattheweppelsheimer 3 years ago.
explain check for wp-settings.php in parent before loading wp-config.php in parent

Download all attachments as: .zip

Change History (6)

@mattheweppelsheimer
3 years ago

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

#1 @mattheweppelsheimer
3 years ago

  • Keywords has-patch added

Patch adds the following docs to explain:

/*
 * Only get wp-config.php from the parent directory
 * if wp-settings.php is not also in the parent directory, to
 * avoid cases where the current directory is a nested
 * installation, e.g. / is WordPressA and /blog/ is WordPressB.
 */
Last edited 3 years ago by mattheweppelsheimer (previous) (diff)

#2 @mattheweppelsheimer
3 years ago

And thank you @dd32 for clarifying the reason for me.

This ticket was mentioned in Slack in #core by mattheweppelsheimer. View the logs.


3 years ago

#4 @DrewAPicture
3 years ago

  • Milestone changed from Awaiting Review to 4.2

#5 @DrewAPicture
3 years ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 31463:

Add inline documentation to clarify the reasoning behind the various conditions that control how WP is loaded.

Props mattheweppelsheimer for the initial patch.
Fixes #30935.

Note: See TracTickets for help on using tickets.