diff options
author | David M <davidmj@users.sourceforge.net> | 2006-04-05 01:17:05 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-04-05 01:17:05 +0000 |
commit | 09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4 (patch) | |
tree | a1d2139d2c920cecd3e2ba07a66e66ea7671d38e /phpBB/includes/functions_template.php | |
parent | 0293556bc983ef01d6adc3389857d51d617d92aa (diff) | |
download | forums-09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4.tar forums-09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4.tar.gz forums-09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4.tar.bz2 forums-09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4.tar.xz forums-09d9cd6e24d6c8ee13c9e667590a9ef983a20ca4.zip |
- This should work! :D
git-svn-id: file:///svn/phpbb/trunk@5760 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_template.php')
-rw-r--r-- | phpBB/includes/functions_template.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 51e9d7564c..f7032d0e3c 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -234,7 +234,7 @@ class template_compile // This will handle the remaining root-level varrefs if (!$this->template->static_lang) { - $text_blocks = preg_replace('#\{L_([\w\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); + $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); } else { @@ -430,11 +430,11 @@ class template_compile $i = $is_arg_start; default: - if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?([A-Z0-9\-_]+)$#s', $token, $varrefs)) + if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Z])([A-Z0-9\-_]+)#s', $token, $varrefs)) { $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_tpldata[\'.\'][0][\'' . $varrefs[3] . '\']'); } - else if (preg_match('#^\.([a-z0-9\-_.]+)$#s', $token, $varrefs)) + else if (preg_match('#^\.([a-z0-9\-_]+\.?)+$#s', $token, $varrefs)) { $_tok = $this->generate_block_data_ref($varrefs[1], false); $token = "(isset($_tok) && sizeof($_tok))"; @@ -453,7 +453,7 @@ class template_compile */ function compile_tag_define($tag_args, $op) { - preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$([A-Z][A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); + preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match); if (empty($match[2]) || (empty($match[4]) && $op)) { |