Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#18174 closed defect (bug) (invalid)

wp-load.php dirname(ABSPATH) changes to wrong directory.

Reported by: amereservant's profile amereservant Owned by:
Milestone: Priority: normal
Severity: major Version: 3.2.1
Component: Filesystem API Keywords:
Focuses: Cc:

Description

On line 31 of my wp-load.php file, I have the following:

} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && ! file_exists( dirname(ABSPATH) . '/wp-settings.php' ) ) {

The problem is with the dirname(ABSPATH) part since I was installing it into a sub-directory and this causes it to convert ABSPATH to the parent directory instead. I caught this when I had a temporary wp-config.php file in my parent directory and the install screen would never load.

The fix should be changing dirname(ABSPATH) to realpath(ABSPATH) or to just use the ABSPATH constant and remove the forward slash from line 31.

Change History (1)

#1 @nacin
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is a feature. wp-config.php can appear one level up, as long as it does not belong to another install (hence the check for wp-settings as well).

The point is to allow for WordPress to be set up as an SVN external, thus the directory structure would look like:

  • wp-config.php
  • wordpress/
  • custom-content-directory/
Note: See TracTickets for help on using tickets.