mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
- Stop people messing around #45935
- Ensure the Accept-Language header actually picks up a directory. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9527 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -175,7 +175,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
|
||||
// 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))
|
||||
if (file_exists($phpbb_root_path . 'language/' . $accept_lang) && is_dir($phpbb_root_path . 'language/' . $accept_lang))
|
||||
{
|
||||
$language = $accept_lang;
|
||||
break;
|
||||
@@ -184,7 +184,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
|
||||
{
|
||||
// No match on xx_yy so try xx
|
||||
$accept_lang = substr($accept_lang, 0, 2);
|
||||
if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
|
||||
if (file_exists($phpbb_root_path . 'language/' . $accept_lang) && is_dir($phpbb_root_path . 'language/' . $accept_lang))
|
||||
{
|
||||
$language = $accept_lang;
|
||||
break;
|
||||
@@ -218,7 +218,7 @@ if (!$language)
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
if (!file_exists($phpbb_root_path . 'language/' . $language))
|
||||
if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_root_path . 'language/' . $language))
|
||||
{
|
||||
die('No language found!');
|
||||
}
|
||||
|
Reference in New Issue
Block a user