From 2c55671767e194fb37cae674c0730e4bc50c0356 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Mon, 1 Jul 2013 09:19:30 -0500 Subject: [PATCH] [feature/twig] Fixing div by replacement PHPBB3-11598 --- phpBB/includes/template/twig/lexer.php | 6 +++--- 1 file 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 ''; }; + // 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('##', $callback, $code); }