[ticket/11701] Fix regex for appending |length

PHPBB3-11701
This commit is contained in:
Nathaniel Guse 2013-07-19 11:31:52 -05:00 committed by Nathan Guse
parent c0b9db1c62
commit 2d764ef7d5

View file

@ -226,10 +226,10 @@ class phpbb_template_twig_lexer extends Twig_Lexer
$inner = preg_replace('#\s\$([a-zA-Z_0-9]+)#', ' definition.$1', $inner);
// Replace .foo with loops.foo|length
$inner = preg_replace('#\s\.([a-zA-Z_0-9]+)#', ' loops.$1|length', $inner);
$inner = preg_replace('#\s\.([a-zA-Z_0-9]+) #', ' loops.$1|length ', $inner);
// Replace .foo.bar with foo.bar|length
$inner = preg_replace('#\s\.([a-zA-Z_0-9\.]+)#', ' $1|length', $inner);
$inner = preg_replace('#\s\.([a-zA-Z_0-9\.]+) #', ' $1|length ', $inner);
return "<!-- {$matches[1]}IF{$inner}-->";
};