diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-03-09 19:02:44 -0600 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-03-09 19:02:44 -0600 |
commit | 3f5d938a95669e9985de5593af836b35bb25e872 (patch) | |
tree | adcf329377c428a2891ac883a58a9ce9d128ded1 | |
parent | 48bad80f4a06c4681e2bf38c8b47a71f1b575e70 (diff) | |
parent | 1ebb17c698ce17147abec0af5048ac522014cf45 (diff) | |
download | forums-3f5d938a95669e9985de5593af836b35bb25e872.tar forums-3f5d938a95669e9985de5593af836b35bb25e872.tar.gz forums-3f5d938a95669e9985de5593af836b35bb25e872.tar.bz2 forums-3f5d938a95669e9985de5593af836b35bb25e872.tar.xz forums-3f5d938a95669e9985de5593af836b35bb25e872.zip |
Merge remote-tracking branch 'remotes/marc/ticket/11323' into develop
# By Marc Alexander
# Via Marc Alexander
* remotes/marc/ticket/11323:
[ticket/11323] Reduce additional code and revert regex to previous one
[ticket/11323] Enable tests for inclusion of defined variables
[ticket/11323] Correctly treat variables in template defines
-rw-r--r-- | phpBB/includes/template/filter.php | 13 | ||||
-rw-r--r-- | tests/template/template_test.php | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index f73ad28ba1..9e8ad2fef0 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -843,7 +843,18 @@ class phpbb_template_filter extends php_user_filter return 'unset(' . (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ');'; } - $parsed_statement = implode(' ', $this->compile_expression($match[3])); + /* + * Define tags that contain template variables (enclosed in curly brackets) + * need to be treated differently. + */ + if (substr($match[3], 1, 1) == '{' && substr($match[3], -2, 1) == '}') + { + $parsed_statement = implode(' ', $this->compile_expression(substr($match[3], 2, -2))); + } + else + { + $parsed_statement = implode(' ', $this->compile_expression($match[3])); + } return (($match[1]) ? $this->generate_block_data_ref(substr($match[1], 0, -1), true, true) . '[\'' . $match[2] . '\']' : '$_tpldata[\'DEFINE\'][\'.\'][\'' . $match[2] . '\']') . ' = ' . $parsed_statement . ';'; } diff --git a/tests/template/template_test.php b/tests/template/template_test.php index f43157775a..56cc7a9de5 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -197,8 +197,6 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array('loop'), '', ), - /* Currently fail on develop: - http://tracker.phpbb.com/browse/PHPBB3-11323 array( 'include_define_variable.html', array('VARIABLE' => 'variable.html'), @@ -213,7 +211,6 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), 'value', ), - */ /* no top level nested loops array( 'loop_vars.html', |