aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/template/twig/lexer.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/includes/template/twig/lexer.php b/phpBB/includes/template/twig/lexer.php
index 258b913a2c..a2afcf18be 100644
--- a/phpBB/includes/template/twig/lexer.php
+++ b/phpBB/includes/template/twig/lexer.php
@@ -177,12 +177,12 @@ class phpbb_template_twig_lexer extends Twig_Lexer
// Replace .test with test|length
$matches[1] = preg_replace('#\s\.([a-zA-Z_0-9]+)#', ' $1|length', $matches[1]);
- // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces?)
- $matches[1] = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $matches[1]);
-
return '<!-- IF' . $matches[1] . '-->';
};
+ // Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces)
+ $code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code);
+
return preg_replace_callback('#<!-- IF((.*)[\s][\$|\.|!]([^\s]+)(.*))-->#', $callback, $code);
}