aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/bbcode.php18
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php2
2 files changed, 3 insertions, 17 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 0c9869fe25..ac5b3e6390 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -403,14 +403,7 @@ class bbcode
// Replace {L_*} lang strings
$bbcode_tpl = preg_replace_callback('/{L_([A-Z0-9_]+)}/', function ($match) use ($user) {
- if (!empty($user->lang[$match['1']]))
- {
- return $user->lang[$match['1']];
- }
- else
- {
- return ucwords(strtolower(str_replace('_', ' ', $match['1'])));
- }
+ return (!empty($user->lang[$match[1]])) ? $user->lang($match[1]) : ucwords(strtolower(str_replace('_', ' ', $match[1])));
}, $bbcode_tpl);
if (!empty($rowset[$bbcode_id]['second_pass_replace']))
@@ -536,14 +529,7 @@ class bbcode
);
$tpl = preg_replace_callback('/{L_([A-Z0-9_]+)}/', function ($match) use ($user) {
- if (!empty($user->lang[$match['1']]))
- {
- return $user->lang[$match['1']];
- }
- else
- {
- return ucwords(strtolower(str_replace('_', ' ', $match['1'])));
- }
+ return (!empty($user->lang[$match[1]])) ? $user->lang($match[1]) : ucwords(strtolower(str_replace('_', ' ', $match[1])));
}, $tpl);
if (!empty($replacements[$tpl_name]))
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 1faec590aa..b674a457c1 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -509,7 +509,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Build all three language arrays
preg_replace_callback('#^((RULE|ACTION|CHECK)_([A-Z0-9_]+))$#', function ($match) use(&$rule_lang, &$action_lang, &$check_lang, $user) {
${strtolower($match[2]) . '_lang'}[constant($match[1])] = $user->lang['PM_' . $match[2]][$match[3]];
- } , array_keys(get_defined_constants()));
+ }, array_keys(get_defined_constants()));
/*
Rule Ordering: