[wp-trac] [WordPress Trac] #34913: Unscheduling cron jobs fails when original arguments were not an array.
WordPress Trac
noreply at wordpress.org
Tue Feb 23 09:45:53 UTC 2016
#34913: Unscheduling cron jobs fails when original arguments were not an array.
-------------------------------------------------+-------------------------
Reporter: jrf | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Cron API | Review
Severity: normal | Version: 3.0
Keywords: has-patch has-unit-tests 2nd- | Resolution:
opinion | Focuses:
-------------------------------------------------+-------------------------
Changes (by swissspidy):
* keywords: has-patch has-unit-tests => has-patch has-unit-tests 2nd-
opinion
Comment:
> The Cron API does not check whether the cron job arguments passed are an
array when scheduling a cron job. This inadvertently allows for scheduling
cron jobs with string, integer or other arguments.
How many plugins really do this? Is it worth papering over their faulty
code and properly enabling non-array arguments? Couldn't we just call
`_doing_it_wrong()` and return false?
See also #35491, where I suggested passing `false` to
`wp_next_scheduled()` in order to get the next scheduled event for a hook
regardless of the arguments. This patch here would prevent that from
happening.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34913#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list