mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +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
|
// Set correct format ... guess full xx_yy form
|
||||||
$accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2);
|
$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;
|
$language = $accept_lang;
|
||||||
break;
|
break;
|
||||||
@@ -184,7 +184,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
|
|||||||
{
|
{
|
||||||
// No match on xx_yy so try xx
|
// No match on xx_yy so try xx
|
||||||
$accept_lang = substr($accept_lang, 0, 2);
|
$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;
|
$language = $accept_lang;
|
||||||
break;
|
break;
|
||||||
@@ -218,7 +218,7 @@ if (!$language)
|
|||||||
closedir($dir);
|
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!');
|
die('No language found!');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user