From db6c28b07a26274b2b050f317a2880b954b06330 Mon Sep 17 00:00:00 2001 From: Claus Due Date: Tue, 23 Apr 2024 13:59:35 +0200 Subject: [PATCH] [BUGFIX] Avoid issues with mismatched argument types in v:iterator.for --- Classes/ViewHelpers/Iterator/ForViewHelper.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Classes/ViewHelpers/Iterator/ForViewHelper.php b/Classes/ViewHelpers/Iterator/ForViewHelper.php index 191bdce31..2ee56f797 100644 --- a/Classes/ViewHelpers/Iterator/ForViewHelper.php +++ b/Classes/ViewHelpers/Iterator/ForViewHelper.php @@ -38,17 +38,21 @@ public static function renderStatic( \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ) { - /** @var int $to */ + /** @var int|string $to */ $to = $arguments['to']; - /** @var int $from */ + /** @var int|string $from */ $from = $arguments['from']; - /** @var int $step */ + /** @var int|string $step */ $step = $arguments['step']; /** @var string|null $iteration */ $iteration = $arguments['iteration']; $content = ''; $variableProvider = $renderingContext->getVariableProvider(); + $to = (integer) $to; + $from = (integer) $from; + $step = (integer) $step; + if (0 === $step) { throw new \RuntimeException('"step" may not be 0.', 1383267698); }