diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-09-26 10:59:14 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-09-26 10:59:14 +0200 |
commit | e8303bc3199081d1f9f0679d3b98298ccdc49deb (patch) | |
tree | 4c30b0332e46434356567f3cbad10d831295b620 /phpBB/phpbb/template/twig/lexer.php | |
parent | Merge pull request #1733 from nickvergessen/ticket/11866 (diff) | |
parent | [ticket/11816] Fix multiple parenthesis as well before $VARs in templates (diff) | |
download | phpbb-e8303bc3199081d1f9f0679d3b98298ccdc49deb.tar.gz phpbb-e8303bc3199081d1f9f0679d3b98298ccdc49deb.tar.bz2 phpbb-e8303bc3199081d1f9f0679d3b98298ccdc49deb.zip |
Merge remote-tracking branch 'EXreaction/ticket/11816-2' into develop
* EXreaction/ticket/11816-2:
[ticket/11816] Fix multiple parenthesis as well before $VARs in templates
Diffstat (limited to 'phpBB/phpbb/template/twig/lexer.php')
-rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index a73d276e62..d832fbf84e 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -231,18 +231,18 @@ class lexer extends \Twig_Lexer { $inner = $matches[2]; // Replace $TEST with definition.TEST - $inner = preg_replace('#(\s\(?!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner); + $inner = preg_replace('#(\s\(*!?)\$([a-zA-Z_0-9]+)#', '$1definition.$2', $inner); // Replace .foo with loops.foo|length - $inner = preg_replace('#(\s\(?!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner); + $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9]+)([^a-zA-Z_0-9\.])#', '$1loops.$2|length$3', $inner); // Replace .foo.bar with foo.bar|length - $inner = preg_replace('#(\s\(?!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner); + $inner = preg_replace('#(\s\(*!?)\.([a-zA-Z_0-9\.]+)([^a-zA-Z_0-9\.])#', '$1$2|length$3', $inner); return "<!-- {$matches[1]}IF{$inner}-->"; }; - return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(?!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code); + return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code); } /** |