[wp-trac] [WordPress Trac] #64404: Uncaught DivisionByZeroError: Modulo by zero

WordPress Trac noreply at wordpress.org
Tue Feb 24 10:35:27 UTC 2026


#64404: Uncaught DivisionByZeroError: Modulo by zero
----------------------------+--------------------------
 Reporter:  kaushiksomaiya  |       Owner:  westonruter
     Type:  defect (bug)    |      Status:  accepted
 Priority:  normal          |   Milestone:  7.0
Component:  Cron API        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+--------------------------

Comment (by vapvarun):

 @westonruter Thanks for the quick follow-up and for merging trunk into the
 PR. Re-tested PR #10619 on `d1c3ba618d`, PHP 8.2.29 — all 74 cron tests
 pass cleanly now. The `sprintf()` issue from comment:5 appears to have
 been resolved by the trunk merge. My earlier testing was before that
 merge, so the failure was real at the time but is no longer an issue.

 The updated PR looks great. Nice touch validating `$event->interval` after
 the `schedule_event` filter rather than before event creation — that also
 catches cases where a filter might set a bad interval.

 Two suggestions on the test coverage:

 1. The current test only covers negative intervals. The original bug was
 `'interval' => false` - might be worth adding that as a test case
 alongside zero:

 {{{#!php
 $schedules['bad_false'] = array(
     'interval' => false,
     'display'  => 'Broken interval (false)',
 );
 $schedules['bad_zero'] = array(
     'interval' => 0,
     'display'  => 'Broken interval (zero)',
 );
 }}}

 2. No test for the `$wp_error = false` path (should return `false` instead
 of `WP_Error`).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64404#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list