Make WordPress Core


Ignore:
Timestamp:
09/12/2013 06:56:20 AM (10 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-load.php

    r25385 r25396  
    5151    require_once( ABSPATH . WPINC . '/functions.php' );
    5252
    53     // Set a path for the link to the installer
    54     if ( strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) !== false ) {
    55         $path = 'setup-config.php';
    56     } elseif ( file_exists( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/wp-admin/setup-config.php' ) ) {
    57         $path = 'wp-admin/setup-config.php';
    58     } else {
    59         // WordPress files are in a sub directory, and the user is hitting the index.php in the parent directory
    60         $path = str_replace( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/', '', dirname( __FILE__ ) . '/wp-admin/setup-config.php' );
    61     }
     53    $path = wp_guess_url() . '/wp-admin/setup-config.php';
    6254
    6355    // Die with an error message
Note: See TracChangeset for help on using the changeset viewer.