[wp-trac] [WordPress Trac] #56490: wp-cron.php using count() on null

WordPress Trac noreply at wordpress.org
Thu Sep 1 17:53:22 UTC 2022


#56490: wp-cron.php using count() on null
--------------------------+------------------------------
 Reporter:  Bishoy.A      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cron API      |     Version:  6.0.2
 Severity:  normal        |  Resolution:
 Keywords:  php8          |     Focuses:
--------------------------+------------------------------

Comment (by SergeyBiryukov):

 Hi there, welcome to WordPess Trac! Thanks for the ticket.

 I have to admit I'm not sure where the `null` value for `$args` is coming
 from. Looking at [source:tags/6.0.1/src/wp-includes/cron.php#L228
 wp_schedule_event()], which is used for the
 `wp_privacy_delete_old_export_files` hook, the default value for the
 `$args` parameter is an empty array, not `null`.

 I've also been using WordPress on PHP 8.x for almost two years, but have
 never encountered this issue yet, so the steps to reproduce it on a clean
 install would be helpful here.

 Could it be that some plugin used the `schedule_event` hook before being
 disabled, and has somehow reset the `args` parameter to `null`, which is
 now saved to the cron array even after the plugin is disabled?

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


More information about the wp-trac mailing list