Skip to content

Commit

Permalink
Merge pull request #4963 from dgroddick/locate-wp-config-path
Browse files Browse the repository at this point in the history
Use `dirname()` instead of `..` to locate `wp-config.php` to match Core behavior
  • Loading branch information
schlessera committed Oct 30, 2018
2 parents d21f663 + a080709 commit eb681ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function locate_wp_config() {

if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
$path = ABSPATH . 'wp-config.php';
} elseif ( file_exists( ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '/../wp-settings.php' ) ) {
} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
$path = ABSPATH . '../wp-config.php';
}

Expand Down

0 comments on commit eb681ee

Please sign in to comment.