diff options
Diffstat (limited to 'phpBB/install/index.php')
-rw-r--r-- | phpBB/install/index.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php index e3f9bda372..bba26fde7a 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -98,9 +98,9 @@ request_var('', 0, false, false, $request); // "dependency injection" for a func // Try and load an appropriate language if required $language = basename(request_var('language', '')); -if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language) +if ($request->header('Accept-Language') && !$language) { - $accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); + $accept_lang_ary = explode(',', strtolower($request->header('Accept-Language'))); foreach ($accept_lang_ary as $accept_lang) { // Set correct format ... guess full xx_yy form @@ -427,15 +427,17 @@ class module */ function redirect($page) { + global $request; + // HTTP_HOST is having the correct browser url in most cases... - $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); - $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); - $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; + $server_name = strtolower($request->header('Host', $request->server('SERVER_NAME'))); + $server_port = $request->server('SERVER_PORT', 0); + $secure = $request->is_secure() ? 1 : 0; - $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); + $script_name = $request->server('PHP_SELF'); if (!$script_name) { - $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + $script_name = $request->server('REQUEST_URI'); } // Replace backslashes and doubled slashes (could happen on some proxy setups) |