aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/twig
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-19 12:40:53 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-19 12:40:53 -0500
commit9152455d706adafa4e89bfdf6acc4b7c101f6f0a (patch)
tree9bf8e2e00c802bbe7fdb9e65da25f69bfda48a75 /phpBB/phpbb/template/twig
parent6ba2fb6d62bb1429665f9e1b4f22dd241508950b (diff)
downloadforums-9152455d706adafa4e89bfdf6acc4b7c101f6f0a.tar
forums-9152455d706adafa4e89bfdf6acc4b7c101f6f0a.tar.gz
forums-9152455d706adafa4e89bfdf6acc4b7c101f6f0a.tar.bz2
forums-9152455d706adafa4e89bfdf6acc4b7c101f6f0a.tar.xz
forums-9152455d706adafa4e89bfdf6acc4b7c101f6f0a.zip
[ticket/11816] Fix multiple parenthesis as well before $VARs in templates
PHPBB3-11816
Diffstat (limited to 'phpBB/phpbb/template/twig')
-rw-r--r--phpBB/phpbb/template/twig/lexer.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 16a693cd7c..ea563d58e2 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -229,18 +229,18 @@ class phpbb_template_twig_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);
}
/**