[wp-trac] [WordPress Trac] #54906: Check _get_cron_array type in upgrade_590 routine

WordPress Trac noreply at wordpress.org
Tue Jan 25 22:04:51 UTC 2022


#54906: Check _get_cron_array type in upgrade_590 routine
----------------------------+-----------------------------
 Reporter:  chrisvanpatten  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Cron API        |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 When the `upgrade_590` DB routine is run on a site without the `cron` site
 option, `_get_cron_array` returns false which causes a TypeError when the
 return value is run through `array_filter`.

 https://github.com/WordPress/WordPress/blob/638ef7815ec29318434365ffde1d3cef7437b948
 /wp-admin/includes/upgrade.php#L2275-L2277

 {{{
 [25-Jan-2022 21:33:45 UTC] PHP Fatal error:  Uncaught TypeError:
 array_filter(): Argument #1 ($array) must be of type array, bool given in
 /var/www/html/web/wp/wp-admin/includes/upgrade.php:2273
 }}}

 In particular, I encountered this on a local multisite network with
 several sites which had been created but not yet used. Running the upgrade
 routine worked on the sites which had been used (and thus had `cron` site
 options) but failed on the others.

 Related: #53940

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54906>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list