1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-13 12:35:06 +01:00

Fixed: if phpBB isn't installed, it redirects to http://host.tld\/install/index.php on my Windows dev server

Changed: instead of undoubling double slashes, we replace any number of consecutive backslashes and forward slashes with a single slash


git-svn-id: file:///svn/phpbb/trunk@6204 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2006-07-23 20:59:41 +00:00
parent 4680dfce39
commit 185702fd5d

View File

@ -124,10 +124,10 @@ if (!defined('PHPBB_INSTALLED'))
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
// Replace backslashes and doubled slashes (could happen on some proxy setups)
$script_name = str_replace(array('\\', '//'), '/', $script_name);
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
$script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
$script_path = str_replace('//', '/', $script_path);
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;