mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This fixes a "Deprecated: Automatic conversion of false to array is deprecated" warning on PHP 8.1. In `wp_schedule_event()`, the cron info array is retrieved via a call to `_get_cron_array()`, but as the documentation (correctly) states, the return type of that function is `array|false`, where `false` is returned for a virgin site, with no cron jobs scheduled yet. However, no type check is done on the return value, and the `wp_schedule_event()` function just blindly continues by assigning a value to a subkey of the `$crons` "array". Fixed by adding validation for the returned value from `_get_cron_array()` and initializing an empty array if `false` was returned. Reference: [https://developer.wordpress.org/reference/functions/_get_cron_array/ WordPress Developer Resources: _get_cron_array()] Props jrf, hellofromTonya, lucatume, pbearne, iluy, pedromendonca, SergeyBiryukov. See #53635. git-svn-id: https://develop.svn.wordpress.org/trunk@51619 602fd350-edb4-49c9-b593-d223f7449a82 |
||
|---|---|---|
| .. | ||
| e2e | ||
| gutenberg | ||
| phpunit | ||
| qunit | ||