[wp-trac] [WordPress Trac] #58221: Cast (int) $cron->time - time() to prevent String - int error

WordPress Trac noreply at wordpress.org
Sun Apr 30 13:31:25 UTC 2023


#58221: Cast (int) $cron->time - time() to prevent String - int error
----------------------------+------------------------------
 Reporter:  toddlahman      |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Site Health     |     Version:  6.2
 Severity:  critical        |  Resolution:  maybelater
 Keywords:  has-patch php8  |     Focuses:
----------------------------+------------------------------

Comment (by SergeyBiryukov):

 Thanks for the follow-up! This is likely related to [33646] & [33727] /
 #33423.

 Due to accidentally reversed parameters passed to
 `wp_schedule_single_event()` in [33615], it was actually possible for the
 cron array to have a `wp_batch_split_terms` array key instead of an
 integer value. The issue was introduced in WordPress 4.3 and fixed in
 4.3.1 via an upgrade routine which unschedules the invalid cron entries,
 though apparently they can still be found on some sites.

 Validation of the `$timestamp` parameter was added a bit later in [33936]
 / #33475 for WordPress 4.4.

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


More information about the wp-trac mailing list