diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-09-13 06:43:40 -0700 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-09-13 06:43:40 -0700 |
commit | 16c6e439149cee19b84ab809e913eb41bc5f4fd9 (patch) | |
tree | 839db078e52b5362c1b8e8541411ce3dba3b06a4 | |
parent | fc7a35be38caa52df29b7126a57d461efd5a5d06 (diff) | |
parent | 658f6e204510b328509a0387eb9711617fdc3bee (diff) | |
download | forums-16c6e439149cee19b84ab809e913eb41bc5f4fd9.tar forums-16c6e439149cee19b84ab809e913eb41bc5f4fd9.tar.gz forums-16c6e439149cee19b84ab809e913eb41bc5f4fd9.tar.bz2 forums-16c6e439149cee19b84ab809e913eb41bc5f4fd9.tar.xz forums-16c6e439149cee19b84ab809e913eb41bc5f4fd9.zip |
Merge pull request #1709 from rechosen/ticket/11843
[ticket/11843] Make the twig lexer fix DEFINE variables with underscores again
-rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 2 | ||||
-rw-r--r-- | tests/template/template_test.php | 2 | ||||
-rw-r--r-- | tests/template/templates/include_define_variable.html | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index 8b72a06642..16a693cd7c 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -75,7 +75,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer // Fix tokens that may have inline variables (e.g. <!-- DEFINE $TEST = '{FOO}') $code = $this->fix_inline_variable_tokens(array( - 'DEFINE \$[a-zA-Z0-9]+ =', + 'DEFINE \$[a-zA-Z0-9_]+ =', 'INCLUDE', 'INCLUDEPHP', 'INCLUDEJS', diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 1649604492..2cca20f4c2 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -237,7 +237,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array('VARIABLE' => 'variable.html'), array(), array(), - 'variable.html', + "variable.html\nvariable.html\nvariable.html", ), array( 'include_loop_define.html', diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html index aff9b574c2..6052657c97 100644 --- a/tests/template/templates/include_define_variable.html +++ b/tests/template/templates/include_define_variable.html @@ -1,2 +1,8 @@ <!-- DEFINE $DEF = '{VARIABLE}' --> <!-- INCLUDE {$DEF} --> + +<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' --> +<!-- INCLUDE {$DEF_WITH_UNDERSCORES} --> + +<!-- DEFINE $DEF123 = '{VARIABLE}' --> +<!-- INCLUDE {$DEF123} --> |