diff options
| author | Chris Smith <toonarmy@phpbb.com> | 2009-03-31 12:21:36 +0000 |
|---|---|---|
| committer | Chris Smith <toonarmy@phpbb.com> | 2009-03-31 12:21:36 +0000 |
| commit | 193396e9d0488805d96721cce642d7b6f33f7810 (patch) | |
| tree | 51cea0b6fae1c62821eb09793bf8a97c860d2748 /phpBB/includes/functions_template.php | |
| parent | 607389caf0c91dac9f8301ea620c25415b85ca61 (diff) | |
| download | forums-193396e9d0488805d96721cce642d7b6f33f7810.tar forums-193396e9d0488805d96721cce642d7b6f33f7810.tar.gz forums-193396e9d0488805d96721cce642d7b6f33f7810.tar.bz2 forums-193396e9d0488805d96721cce642d7b6f33f7810.tar.xz forums-193396e9d0488805d96721cce642d7b6f33f7810.zip | |
Enforce correct case for template variables. {var} no longer works for example.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9419 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 46c7cedc01..42a5eb3248 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -256,19 +256,19 @@ class template_compile // 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(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks); + $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->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(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks); + $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks); } // Handle remaining varrefs - $text_blocks = preg_replace('#\{([a-z0-9\-_]+)\}#is', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks); - $text_blocks = preg_replace('#\{\$([a-z0-9\-_]+)\}#is', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks); + $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks); + $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks); return; } |
