[wp-trac] [WordPress Trac] #63987: wp_get_scheduled_event() incorrectly returns false for cron events scheduled with a timestamp of 0.
WordPress Trac
noreply at wordpress.org
Thu Mar 19 06:49:21 UTC 2026
#63987: wp_get_scheduled_event() incorrectly returns false for cron events
scheduled with a timestamp of 0.
-------------------------------------------------+-------------------------
Reporter: codekraft | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Cron API | Version:
Severity: normal | Resolution: wontfix
Keywords: has-patch has-unit-tests has-test- | Focuses:
info 2nd-opinion close |
-------------------------------------------------+-------------------------
Comment (by wildworks):
@codekraft Thank you for explaining it in detail.
> Here is how it happens using public functions:
> 1. If a third-party plugin accidentally passes a float between 0 and 1
(e.g., `0.5`, maybe due a wrong calculation), the validation `!
is_numeric( 0.5 ) || 0.5 <= 0` evaluates to `false`. The error check is
bypassed.
> 2. The event is passed to the core system to be saved.
> 3. When WordPress sets this in the multidimensional cron array, PHP
automatically truncates the `0.5` float key into an integer `0`.
I think this is certainly a problem that needs to be solved.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63987#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list