From 185702fd5de5c7dfa9761ff0e79b7b410bcd1554 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Sun, 23 Jul 2006 20:59:41 +0000 Subject: [PATCH] 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 --- phpBB/common.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index a628dcf1de..0277b356cf 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -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;