diff options
-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/define.html | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index a33de70d69..7ab569313c 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -130,7 +130,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer // E.g. 'asdf'"' -> asdf'" // E.g. "asdf'"" -> asdf'" // E.g. 'asdf'" -> 'asdf'" - $matches[2] = preg_replace('#^([\'"])?(.+?)\1$#', '$2', $matches[2]); + $matches[2] = preg_replace('#^([\'"])?(.*?)\1$#', '$2', $matches[2]); // Replace template variables with start/end to parse variables (' ~ TEST ~ '.html) $matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]); diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 38eb072df8..f2e3903458 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())), array(), - "xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?", + "xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?\n[]", ), array( 'define_advanced.html', diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html index 66e874ca63..e6c8ef49c9 100644 --- a/tests/template/templates/define.html +++ b/tests/template/templates/define.html @@ -14,3 +14,5 @@ $VALUE == 'abc' {$VALUE} <!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' --> {$VALUE} +<!-- DEFINE $VALUE = '' --> +[{$VALUE}] |