diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-01 17:46:08 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-01 17:46:08 +0000 |
commit | cf4e90fdf148c3b77590fd688426808781850370 (patch) | |
tree | f8f19bd796667241832c3e28d708f4d450aad0a6 /phpBB/includes/acp/acp_language.php | |
parent | 57e842edceed812ab86d382a326615f1f1180d68 (diff) | |
download | forums-cf4e90fdf148c3b77590fd688426808781850370.tar forums-cf4e90fdf148c3b77590fd688426808781850370.tar.gz forums-cf4e90fdf148c3b77590fd688426808781850370.tar.bz2 forums-cf4e90fdf148c3b77590fd688426808781850370.tar.xz forums-cf4e90fdf148c3b77590fd688426808781850370.zip |
#i52
git-svn-id: file:///svn/phpbb/trunk@8117 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_language.php')
-rw-r--r-- | phpBB/includes/acp/acp_language.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index db636fc919..71def79433 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -185,6 +185,55 @@ class acp_language $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + if (!$row) + { + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Before we attempt to write anything let's check if the admin really chose a correct filename + switch ($this->language_directory) + { + case 'email': + // Get email templates + $email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt'); + $email_files = $email_files['email/']; + + if (!in_array($this->language_file, $email_files)) + { + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); + } + break; + + case 'acp': + // Get acp files + $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx); + $acp_files = $acp_files['acp/']; + + if (!in_array($this->language_file, $acp_files)) + { + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); + } + break; + + case 'mods': + // Get mod files + $mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx); + $mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array(); + + if (!in_array($this->language_file, $mods_files)) + { + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); + } + break; + + default: + if (!in_array($this->language_file, $this->main_files)) + { + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); + } + break; + } + if (!$safe_mode) { $mkdir_ary = array('language', 'language/' . $row['lang_iso']); |