From db3a05178b3014bed5a94424b9f443167256e465 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Mon, 18 Oct 2021 13:30:57 +0000 Subject: [PATCH] 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 --- wp-admin/includes/upgrade.php | 21 +++++++++++++++++++++ wp-includes/version.php | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 475608efa7..b558819771 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -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. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 47b53ae64d..9c0e89c590 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.