- Corrected a bug where the 'or' variable was not reset properly on a iterations of for/foreach.

This commit is contained in:
mcndave committed 2021-03-01 16:07:39 +00:00
1 parent 8df38b568c
commit 30af321215
2 files changed
+9 -15

No files matched your search

+3 -8
View File
@@ -20,23 +20,18 @@ class ForToken implements ControlStructure {
return "<?php for ($arguments): {$uid} = 1; ?>";
case "endfor":
if ( $context->iterationStack === null ){
$last = end($context->iterationStack);
}
if ( end($context->iterationStack)['or'] === false ) {
if ( $last['or'] === false ) {
$output = "<?php endfor; ?>";
}
else {
$output = "<?php endif; ?>";
$output = "<?php endif; unset({$last['uid']}) ?>";
}
array_pop($context->iterationStack);
return $output;
case "continue":
return "<?php continue; ?>";
}
}
}