mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-14 15:28:52 +00:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12781] Add tests [ticket/12781] Template regex for IF catch too many things
This commit is contained in:
commit
df38b2829a
3 changed files with 9 additions and 1 deletions
|
@ -285,7 +285,7 @@ class lexer extends \Twig_Lexer
|
|||
return "<!-- {$matches[1]}IF{$inner}-->";
|
||||
};
|
||||
|
||||
return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
|
||||
return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -352,6 +352,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
|
|||
array(),
|
||||
"13FOOBAR|foobar",
|
||||
),
|
||||
array(
|
||||
'if_nested_tags.html',
|
||||
array('S_VALUE' => true,),
|
||||
array(),
|
||||
array(),
|
||||
'inner_value',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
1
tests/template/templates/if_nested_tags.html
Normal file
1
tests/template/templates/if_nested_tags.html
Normal file
|
@ -0,0 +1 @@
|
|||
<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE}
|
Loading…
Add table
Reference in a new issue