Skip to content

Commit 7299b6f

Browse files
Merge remote-tracking branch '34557/divide-by-zero-fatal-error' into comm_jul
2 parents f906144 + 0e8fb6e commit 7299b6f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/code/Magento/Cron/Model/Schedule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function matchCronExpression($expr, $num)
215215
$to = $from;
216216
}
217217

218-
if ($from === false || $to === false) {
218+
if ($from === false || $to === false || $mod == 0) {
219219
throw new CronException(__('Invalid cron expression: %1', $expr));
220220
}
221221

app/code/Magento/Cron/Test/Unit/Model/ScheduleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ public function matchCronExpressionExceptionDataProvider(): array
426426
['1/'], //Invalid cron expression, expecting numeric modulus: 1/
427427
['-'], //Invalid cron expression
428428
['1-2-3'], //Invalid cron expression, expecting 'from-to' structure: 1-2-3
429+
['0/0'],
429430
];
430431
}
431432

0 commit comments

Comments
 (0)