mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Fall back to board default language email template if the file does not exist user's preferred language (#35595)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10447 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -182,9 +182,15 @@ class messenger
|
||||
trigger_error('No template file for emailing set.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if (!trim($template_lang))
|
||||
if (!trim($template_lang) || !file_exists("{$phpbb_root_path}language/{$template_lang}/email/$template_file.txt"))
|
||||
{
|
||||
$template_lang = basename($config['default_lang']);
|
||||
if (file_exists("{$phpbb_root_path}language/{$config['default_lang']}/email/$template_file.txt"))
|
||||
{
|
||||
// fall back to board default language if the user's language is
|
||||
// missing $template_file
|
||||
$template_lang = basename($config['default_lang']);
|
||||
}
|
||||
// Else $tpl->set_custom_template will do a trigger error
|
||||
}
|
||||
|
||||
// tpl_msg now holds a template object we can use to parse the template file
|
||||
|
Reference in New Issue
Block a user