1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11724] Support "ELSE IF" and "ELSEIF" in the same way

PHPBB3-11724
This commit is contained in:
Nathan Guse
2013-07-27 20:02:03 -05:00
parent 26dac64d45
commit d5c56c5d50
3 changed files with 11 additions and 1 deletions

View File

@@ -236,7 +236,8 @@ class phpbb_template_twig_lexer extends Twig_Lexer
// 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('#<!-- (ELSE)?IF((.*)[\s][\$|\.|!]([^\s]+)(.*))-->#', $callback, $code);
// (ELSE)?\s?IF; match IF|ELSEIF|ELSE IF; replace ELSE IF with ELSEIF
return preg_replace_callback('#<!-- (ELSE)?\s?IF(.+?)-->#', $callback, $code);
}
/**