Cron: Remove errant `false` values in cron array when upgrading to 5.9+.

[51916] fixed a bug where `array( `false` )` was added to the cron array when `_get_cron_array()` returned `false`. 

This commit:
* Removes any `false` values from the cron array when upgrading to 5.9+.
* Bumps the database version.

Follow-up to [44917], [51916].

Props peterwilsoncc, jrf.
See #53950.
Built from https://develop.svn.wordpress.org/trunk@51917


git-svn-id: http://core.svn.wordpress.org/trunk@51510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-10-18 13:30:57 +00:00
parent 248c36d748
commit db3a05178b
2 changed files with 23 additions and 2 deletions

View File

@ -832,6 +832,10 @@ function upgrade_all() {
upgrade_560();
}
if ( $wp_current_db_version < 51917 ) {
upgrade_590();
}
maybe_disable_link_manager();
maybe_disable_automattic_widgets();
@ -2248,6 +2252,23 @@ function upgrade_560() {
}
}
/**
* Executes changes made in WordPress 5.9.0.
*
* @ignore
* @since 5.9.0
*/
function upgrade_590() {
global $wp_current_db_version;
if ( $wp_current_db_version < 51917 ) {
$crons = _get_cron_array();
// Remove errant `false` values, see #53950.
$crons = array_filter( $crons );
_set_cron_array( $crons );
}
}
/**
* Executes network-level upgrade routines.
*

View File

@ -16,14 +16,14 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51916';
$wp_version = '5.9-alpha-51917';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 49752;
$wp_db_version = 51917;
/**
* Holds the TinyMCE version.