mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed big problem on Windows when redirecting to install.php - because of SCRIPT_NAME backslashes caused a bit of havoc and need special treatment (from r98869)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102808 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
dcd5ef9c77
commit
bf01c286b0
5
main.php
5
main.php
@ -108,6 +108,11 @@ require_once("core/model/DB.php");
|
||||
if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) {
|
||||
$s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : '';
|
||||
$installURL = "http$s://" . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php';
|
||||
|
||||
// The above dirname() will equate to "\" on Windows when installing directly from http://localhost (not using
|
||||
// a sub-directory), this really messes things up in some browsers. Let's get rid of the backslashes
|
||||
$installURL = str_replace('\\', '', $installURL);
|
||||
|
||||
header("Location: $installURL");
|
||||
die();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user