From b4d6b1e980473914601e1fb1a9c0cc0e4a6fde57 Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Tue, 26 Jan 2010 04:11:58 +0000 Subject: [PATCH] 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 --- phpBB/includes/functions_messenger.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 3286e9171b..4b69b26eb6 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -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,