From 62aa26c9a6681956bfb8af61447cd078271cc0a0 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 2 Jun 2009 22:12:37 +0000 Subject: [PATCH] - 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 --- phpBB/install/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/install/index.php b/phpBB/install/index.php index b1eba60af5..47f1787030 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -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!'); }