[Issue] Avoid divide-by-zero fatal error #37804
Labels
Area: Other Developer Tools
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Projects
This issue is automatically created based on existing pull request: #37479: Avoid divide-by-zero fatal error
Description
While working on Ethan3600/magento2-CronjobManager#122, I noticed that providing asking Magento to validate a cron expression which contains
/0
resulted in a Fatal error, rather than an exception which I could catch. This pull request fixes the divide-by-zero bug and instead produces a sensible exception. Includes unit test.Manual testing scenarios
\Magento\Cron\Model\Schedule::matchCronExpression('0/0', 0)
Contribution checklist
The text was updated successfully, but these errors were encountered: