mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Fix wp_guess_url() to work in every scenario I could find, allows us to use it to determine the correct path to the WordPress Site URL before installation for install.php and setup-config.php redirects. Fixes #24480 Fixes #16884
git-svn-id: https://develop.svn.wordpress.org/trunk@25396 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -50,15 +50,7 @@ if ( file_exists( ABSPATH . 'wp-config.php') ) {
|
||||
|
||||
require_once( ABSPATH . WPINC . '/functions.php' );
|
||||
|
||||
// Set a path for the link to the installer
|
||||
if ( strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) !== false ) {
|
||||
$path = 'setup-config.php';
|
||||
} elseif ( file_exists( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/wp-admin/setup-config.php' ) ) {
|
||||
$path = 'wp-admin/setup-config.php';
|
||||
} else {
|
||||
// WordPress files are in a sub directory, and the user is hitting the index.php in the parent directory
|
||||
$path = str_replace( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/', '', dirname( __FILE__ ) . '/wp-admin/setup-config.php' );
|
||||
}
|
||||
$path = wp_guess_url() . '/wp-admin/setup-config.php';
|
||||
|
||||
// Die with an error message
|
||||
$die = __( "There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started." ) . '</p>';
|
||||
|
||||
Reference in New Issue
Block a user