diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-27 20:02:03 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-27 20:02:03 -0500 |
commit | d5c56c5d503ea4b12852866e2d3b956e92a92aea (patch) | |
tree | 27d3e078443bfd9bb1d317fc2771822959944af8 /phpBB/phpbb/template/twig | |
parent | 26dac64d45944dce14b33a9c82e531f01f9a623f (diff) | |
download | forums-d5c56c5d503ea4b12852866e2d3b956e92a92aea.tar forums-d5c56c5d503ea4b12852866e2d3b956e92a92aea.tar.gz forums-d5c56c5d503ea4b12852866e2d3b956e92a92aea.tar.bz2 forums-d5c56c5d503ea4b12852866e2d3b956e92a92aea.tar.xz forums-d5c56c5d503ea4b12852866e2d3b956e92a92aea.zip |
[ticket/11724] Support "ELSE IF" and "ELSEIF" in the same way
PHPBB3-11724
Diffstat (limited to 'phpBB/phpbb/template/twig')
-rw-r--r-- | phpBB/phpbb/template/twig/lexer.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index 4f88147542..1a640e559e 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -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); } /** |