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 | |
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')
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 3 | ||||
-rw-r--r-- | phpBB/includes/functions_template.php | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d13506b598..ef72152bce 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -134,6 +134,7 @@ <li>[Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (reported by JRSweets)</li> <li>[Fix] Sort backups by date, newest first (Bug #14818)</li> <li>[Fix] Prevent incomplete backups stored if option "store and download" is selected and admin cancel download by removing the option. (Bug #20325)</li> + <li>[Fix] Enforce correct case for template variables</li> <li>[Change] Allow download of conflicting file for later reference in automatic updater</li> <li>[Change] Default difference view is now 'inline' instead of 'side by side'</li> <li>[Change] Added new option for merging differences to conflicting files in automatic updater</li> @@ -877,4 +878,4 @@ </div> </body> -</html>
\ No newline at end of file +</html> 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; } |