From 41d2a2052c4dea17446a638d57234949cc8cfeda Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Mon, 20 Mar 2006 21:03:51 +0000 Subject: [PATCH] Change the handling of language detection to avoid errors if the language header is either not sent by the browser or there is no matching language available. Also added support for forcing a language via the URL for now, this may or may not remain git-svn-id: file:///svn/phpbb/trunk@5676 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 7756bf82ca..ce44daf0f1 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -72,7 +72,8 @@ if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals define('STRIP', (get_magic_quotes_gpc()) ? true : false); // Try and load an appropriate language if required -if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))// && !$language) +$language = request_var('language', ''); +if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $language == '') { $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); foreach ($accept_lang_ary as $accept_lang) @@ -99,7 +100,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))// && !$language) // No appropriate language found ... so let's use the first one in the language // dir, this may or may not be English -if (!$language) +if ($language == '') { $dir = @opendir($phpbb_root_path . 'language'); while ($file = readdir($dir)) @@ -183,7 +184,7 @@ class module $this->error('No installation modules found', __LINE__, __FILE__); } - foreach($module as $row) + foreach ($module as $row) { // Check any module pre-reqs if ($row['module_reqs'] != '') @@ -426,7 +427,7 @@ class module } echo '

' . $lang['INST_ERR_FATAL'] . "

\n"; - echo '

' . $file . ' [ ' . $line . " ]

\n"; + echo '

' . basename($file) . ' [ ' . $line . " ]

\n"; echo '

' . $error . "

\n"; if ($skip) @@ -465,7 +466,7 @@ class module echo '

' . $lang['INST_ERR_FATAL'] . "

\n"; echo '

' . $lang['INST_ERR_FATAL_DB'] . "

\n"; - echo '

' . $file . ' [ ' . $line . " ]

\n"; + echo '

' . basename($file) . ' [ ' . $line . " ]

\n"; echo '

SQL : ' . $sql . "

\n"; echo '

' . $error . "

\n";