aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/classes/template_compile.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-04-18 15:09:19 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-04-18 15:09:19 +0000
commit1042152a55ab2d0764c446949a77f085ab7a77f3 (patch)
tree008dc317ce03e80988c8c79f8c6d0cf263a02b32 /phpBB/includes/classes/template_compile.php
parente3d98fe77b1f2c60ceefa0ddf9091d08815d1f89 (diff)
downloadforums-1042152a55ab2d0764c446949a77f085ab7a77f3.tar
forums-1042152a55ab2d0764c446949a77f085ab7a77f3.tar.gz
forums-1042152a55ab2d0764c446949a77f085ab7a77f3.tar.bz2
forums-1042152a55ab2d0764c446949a77f085ab7a77f3.tar.xz
forums-1042152a55ab2d0764c446949a77f085ab7a77f3.zip
Merge changes made in revisions #r9405 to #r9467
2009-04-18 git-svn-id: file:///svn/phpbb/trunk@9468 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/classes/template_compile.php')
-rw-r--r--phpBB/includes/classes/template_compile.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/includes/classes/template_compile.php b/phpBB/includes/classes/template_compile.php
index 3f6f82f5df..098d8f4817 100644
--- a/phpBB/includes/classes/template_compile.php
+++ b/phpBB/includes/classes/template_compile.php
@@ -187,8 +187,8 @@ class phpbb_template_filter extends php_user_filter
$this->compile_language_tags($text_blocks);
// This will handle the remaining root-level varrefs
- $text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$_rootref['\\1'])) ? \$_rootref['\\1'] : ''; ?>", $text_blocks);
- $text_blocks = preg_replace('#\{\$([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$_tpldata['DEFINE']['.']['\\1'])) ? \$_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
+ $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$_rootref['\\1'])) ? \$_rootref['\\1'] : ''; ?>", $text_blocks);
+ $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$_tpldata['DEFINE']['.']['\\1'])) ? \$_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
return $text_blocks;
}
@@ -201,14 +201,14 @@ class phpbb_template_filter extends php_user_filter
// transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array
if (strpos($text_blocks, '{L_') !== false)
{
- $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$_rootref['L_\\1'])) ? \$_rootref['L_\\1'] : (isset(\$_lang['\\1']) ? \$_lang['\\1'] : '{ \\1 }'); ?>", $text_blocks);
+ $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$_rootref['L_\\1'])) ? \$_rootref['L_\\1'] : ((isset(\$_lang['\\1'])) ? \$_lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
}
// Handle addslashed language variables prefixed with LA_
// If a template variable already exist, it will be used in favor of it...
if (strpos($text_blocks, '{LA_') !== false)
{
- $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$_rootref['LA_\\1'])) ? \$_rootref['LA_\\1'] : ((isset(\$_rootref['L_\\1'])) ? addslashes(\$_rootref['L_\\1']) : (isset(\$_lang['\\1']) ? addslashes(\$_lang['\\1']) : '{ \\1 }')); ?>", $text_blocks);
+ $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$_rootref['LA_\\1'])) ? \$_rootref['LA_\\1'] : ((isset(\$_rootref['L_\\1'])) ? addslashes(\$_rootref['L_\\1']) : ((isset(\$_lang['\\1'])) ? addslashes(\$_lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
}
}