From 6d40b876617422dbca1cb9c0d6b6ac9b43ea1ca3 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 27 Jun 2014 16:04:56 +0200 Subject: [PATCH 1/2] [ticket/12781] Template regex for IF catch too many things PHPBB3-12781 --- phpBB/phpbb/template/twig/lexer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index cceefda7ef..c5dc7273ba 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -285,7 +285,7 @@ class lexer extends \Twig_Lexer return ""; }; - return preg_replace_callback('##', $callback, $code); + return preg_replace_callback('##', $callback, $code); } /** From 7ef983b4267db3a71c849a62f91fa1b0a94a78bb Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 27 Jun 2014 16:41:21 +0200 Subject: [PATCH 2/2] [ticket/12781] Add tests PHPBB3-12781 --- tests/template/template_test.php | 7 +++++++ tests/template/templates/if_nested_tags.html | 1 + 2 files changed, 8 insertions(+) create mode 100644 tests/template/templates/if_nested_tags.html diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 4f5b7629d5..0bbfe3848d 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -352,6 +352,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), "13FOOBAR|foobar", ), + array( + 'if_nested_tags.html', + array('S_VALUE' => true,), + array(), + array(), + 'inner_value', + ), ); } diff --git a/tests/template/templates/if_nested_tags.html b/tests/template/templates/if_nested_tags.html new file mode 100644 index 0000000000..0348a31a8d --- /dev/null +++ b/tests/template/templates/if_nested_tags.html @@ -0,0 +1 @@ +{$INNER_VALUE}