BUGFIX Making sure phpinstaller works on subdomains (see #3167)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68515 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-12-12 01:50:45 +00:00 committed by Sam Minnee
parent c92163198d
commit 25f9a20d29

View File

@ -95,7 +95,8 @@ require_once("core/model/DB.php");
// Redirect to the installer if no database is selected
if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) {
$installURL = dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php';
$s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : '';
$installURL = "http$s://" . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php';
header("Location: $installURL");
die();
}