- Fixed a recursivity bug with the OR token inside another foreach/or instance
This commit is contained in:
1 parent
ce4ef6351a
commit
92e304daf3
2 files changed
+8
-6
No files matched your search
@@ -10,11 +10,15 @@ class ForeachToken implements ControlStructure {
|
||||
switch($token) {
|
||||
case "foreach":
|
||||
$name = "$".uniqid("foreach_");
|
||||
|
||||
$count = count($context->iterationStack ?? []);
|
||||
|
||||
$stack = array_filter($context->iterationStack ?? [], function($item) {
|
||||
return ! $item['or'];
|
||||
});
|
||||
|
||||
$count = count($stack);
|
||||
|
||||
if ( $count > 0 ) {
|
||||
$name .= "[" . $context->iterationStack[$count - 1]['uid'] . "]";
|
||||
$name .= "[" . end($stack)['uid'] . "]";
|
||||
}
|
||||
|
||||
$context->iterationStack[] = [
|
||||
|
||||
Reference in new issue
Block a user