diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-07-03 12:47:30 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-07-03 12:47:30 +0200 |
commit | df38b2829a60a0353a2c9f46646f71d11446ff9f (patch) | |
tree | 3161cd71988e9c8893977431addf416d733ef0b7 | |
parent | 492c0d890e517011624855b62aa22d039db6f2a1 (diff) | |
parent | a0e00889d1a03804625522405824ac8cbce15c22 (diff) | |
download | forums-df38b2829a60a0353a2c9f46646f71d11446ff9f.tar forums-df38b2829a60a0353a2c9f46646f71d11446ff9f.tar.gz forums-df38b2829a60a0353a2c9f46646f71d11446ff9f.tar.bz2 forums-df38b2829a60a0353a2c9f46646f71d11446ff9f.tar.xz forums-df38b2829a60a0353a2c9f46646f71d11446ff9f.zip |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus:
[ticket/12781] Add tests
[ticket/12781] Template regex for IF catch too many things
-rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 2 | ||||
-rw-r--r-- | tests/template/template_test.php | 7 | ||||
-rw-r--r-- | tests/template/templates/if_nested_tags.html | 1 |
3 files changed, 9 insertions, 1 deletions
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 "<!-- {$matches[1]}IF{$inner}-->"; }; - return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code); + return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code); } /** 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 @@ +<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE} |