aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJosh Woody <a_jelly_doughnut@phpbb.com>2010-01-26 03:30:43 +0000
committerJosh Woody <a_jelly_doughnut@phpbb.com>2010-01-26 03:30:43 +0000
commitff1aa876b5e64532384f21d852650e28fd960743 (patch)
tree3e01257389eeaaaea26b1ed1c41ae5e5667a65f7 /phpBB
parent870921c87231c1e637de76295914be53b846469a (diff)
downloadforums-ff1aa876b5e64532384f21d852650e28fd960743.tar
forums-ff1aa876b5e64532384f21d852650e28fd960743.tar.gz
forums-ff1aa876b5e64532384f21d852650e28fd960743.tar.bz2
forums-ff1aa876b5e64532384f21d852650e28fd960743.tar.xz
forums-ff1aa876b5e64532384f21d852650e28fd960743.zip
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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/functions_messenger.php10
2 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 1ddee3b573..f12b58885f 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -146,6 +146,7 @@
<li>[Fix] Correctly hover list menu in UCP and MCP for rtl languages. (Bug #49945)</li>
<li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
<li>[Fix] Deprecate $allow_reply parameter to truncate_string() (Bug #56675)</li>
+ <li>[Fix] Fall back to default language email template if specified file does not exist. (Bug #35595)</li>
<li>[Fix] Update users last visit field correctly when changing activation status. (Bug #56185)</li>
<li>[Fix] Database updater now separates ADD COLUMN from SET NOT NULL and SET DEFAULT, when using PostgreSQL &lt;= 7.4 (Bug #54435)</li>
<li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
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