mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11812] Fix empty define
PHPBB3-11812
This commit is contained in:
parent
5ddb0ba629
commit
c8d5ec8927
3 changed files with 4 additions and 2 deletions
|
@ -130,7 +130,7 @@ class phpbb_template_twig_lexer extends Twig_Lexer
|
||||||
// E.g. 'asdf'"' -> asdf'"
|
// E.g. 'asdf'"' -> asdf'"
|
||||||
// E.g. "asdf'"" -> asdf'"
|
// 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)
|
// Replace template variables with start/end to parse variables (' ~ TEST ~ '.html)
|
||||||
$matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
|
$matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
|
||||||
|
|
|
@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
||||||
array(),
|
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('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(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(
|
array(
|
||||||
'define_advanced.html',
|
'define_advanced.html',
|
||||||
|
|
|
@ -14,3 +14,5 @@ $VALUE == 'abc'
|
||||||
{$VALUE}
|
{$VALUE}
|
||||||
<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
|
<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
|
||||||
{$VALUE}
|
{$VALUE}
|
||||||
|
<!-- DEFINE $VALUE = '' -->
|
||||||
|
[{$VALUE}]
|
||||||
|
|
Loading…
Add table
Reference in a new issue