From bf01c286b090a08a2f923be21141bfde959d43e2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 03:46:40 +0000 Subject: [PATCH] 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 --- main.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.php b/main.php index a493e4551..cb7a04645 100644 --- a/main.php +++ b/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(); }