mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- This should work! :D
git-svn-id: file:///svn/phpbb/trunk@5760 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0293556bc9
commit
09d9cd6e24
1 changed files with 4 additions and 4 deletions
|
@ -234,7 +234,7 @@ class template_compile
|
||||||
// This will handle the remaining root-level varrefs
|
// This will handle the remaining root-level varrefs
|
||||||
if (!$this->template->static_lang)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -430,11 +430,11 @@ class template_compile
|
||||||
$i = $is_arg_start;
|
$i = $is_arg_start;
|
||||||
|
|
||||||
default:
|
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] . '\']');
|
$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);
|
$_tok = $this->generate_block_data_ref($varrefs[1], false);
|
||||||
$token = "(isset($_tok) && sizeof($_tok))";
|
$token = "(isset($_tok) && sizeof($_tok))";
|
||||||
|
@ -453,7 +453,7 @@ class template_compile
|
||||||
*/
|
*/
|
||||||
function compile_tag_define($tag_args, $op)
|
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))
|
if (empty($match[2]) || (empty($match[4]) && $op))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue