diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 8f4e582b3c..85f5f091a0 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -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 |
