diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index c0d5675e4d..96828fb939 100755
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -110,17 +110,18 @@ include($phpbb_root_path . 'includes/template.' . $phpEx);
include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
include($phpbb_root_path . 'includes/cache.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Try and load an appropriate language if required
$language = request_var('language', '');
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
{
- $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ $accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
foreach ($accept_lang_ary as $accept_lang)
{
- // Set correct format ... guess full xx_YY form
- $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
+ // Set correct format ... guess full xx-yy form
+ $accept_lang = substr($accept_lang, 0, 2) . '-' . substr($accept_lang, 3, 2);
if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
{
@@ -129,7 +130,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
}
else
{
- // No match on xx_YY so try xx
+ // No match on xx-yy so try xx
$accept_lang = substr($accept_lang, 0, 2);
if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
{
@@ -319,11 +320,11 @@ class module
'PAGE_TITLE' => $this->get_page_title(),
'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/',
- 'S_USER_LANG' => $language,
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
+ 'S_USER_LANG' => $language,
)
);
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index e8ebd7f726..9665957274 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -553,7 +553,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index?mode=install");
+ $this->p_master->redirect("index.$phpEx?mode=install");
}
$s_hidden_fields = ($img_imagick) ? '' : '';
@@ -725,7 +725,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index?mode=install");
+ $this->p_master->redirect("index.$phpEx?mode=install");
}
$s_hidden_fields = ($img_imagick) ? '' : '';
@@ -880,7 +880,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index?mode=install");
+ $this->p_master->redirect("index.$phpEx?mode=install");
}
$s_hidden_fields = ($img_imagick) ? '' : '';
@@ -964,7 +964,7 @@ class install_install extends module
{
// Someone's been silly and tried calling this page direct
// So we send them back to the start to do it again properly
- $this->p_master->redirect("index?mode=install");
+ $this->p_master->redirect("index.$phpEx?mode=install");
}
$cookie_domain = ($server_name != '') ? $server_name : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');