aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGraham Eames <grahamje@users.sourceforge.net>2006-03-20 21:03:51 +0000
committerGraham Eames <grahamje@users.sourceforge.net>2006-03-20 21:03:51 +0000
commit41d2a2052c4dea17446a638d57234949cc8cfeda (patch)
tree9a29bcdfe1887737b43696f9c33b2c48af7e909e
parentc01c69e63fb3dadb3edf14543a069ffacd39f4a6 (diff)
downloadforums-41d2a2052c4dea17446a638d57234949cc8cfeda.tar
forums-41d2a2052c4dea17446a638d57234949cc8cfeda.tar.gz
forums-41d2a2052c4dea17446a638d57234949cc8cfeda.tar.bz2
forums-41d2a2052c4dea17446a638d57234949cc8cfeda.tar.xz
forums-41d2a2052c4dea17446a638d57234949cc8cfeda.zip
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
-rwxr-xr-xphpBB/install/index.php11
1 files 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 ' <p>' . $lang['INST_ERR_FATAL'] . "</p>\n";
- echo ' <p>' . $file . ' [ ' . $line . " ]</p>\n";
+ echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
echo ' <p><b>' . $error . "</b></p>\n";
if ($skip)
@@ -465,7 +466,7 @@ class module
echo ' <h2 style="color:red;text-align:center">' . $lang['INST_ERR_FATAL'] . "</h2>\n";
echo ' <p>' . $lang['INST_ERR_FATAL_DB'] . "</p>\n";
- echo ' <p>' . $file . ' [ ' . $line . " ]</p>\n";
+ echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
echo ' <p>SQL : ' . $sql . "</p>\n";
echo ' <p><b>' . $error . "</b></p>\n";