- 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:
Chris Smith 2009-06-02 22:12:37 +00:00
parent ffbc25e17a
commit 62aa26c9a6

View file

@ -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!');
}