Further fixes for r10447 and r10448. Correctly account for custom language directories (caught by naderman)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10449 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Josh Woody 2010-01-26 04:11:58 +00:00
parent a314b2807f
commit b4d6b1e980

View file

@ -182,7 +182,16 @@ class messenger
trigger_error('No template file for emailing set.', E_USER_ERROR);
}
if (!trim($template_lang) || !file_exists("{$phpbb_root_path}language/{$template_lang}/email/$template_file.txt"))
if (!$template_path)
{
$path_check = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
}
else
{
$path_check = $template_path;
}
if (!trim($template_lang) || !file_exists("$path_check$template_lang/email/$template_file.txt"))
{
// fall back to board default language if the user's language is
// missing $template_file. If this does not exist either,