mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/11701] Refix regex for appending |length
PHPBB3-11701
This commit is contained in:
parent
2d764ef7d5
commit
ea250a5ef5
1 changed files with 2 additions and 2 deletions
|
@ -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]+)([^a-zA-Z_0-9\.])#', ' loops.$1|length$2', $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\.]+)([^a-zA-Z_0-9\.])#', ' $1|length$2', $inner);
|
||||
|
||||
return "<!-- {$matches[1]}IF{$inner}-->";
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue