Skip to content

Commit

Permalink
[BUGFIX] Avoid issues with mismatched argument types in v:iterator.for
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Apr 23, 2024
1 parent d214a42 commit db6c28b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Classes/ViewHelpers/Iterator/ForViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit db6c28b

Please sign in to comment.