From ac18b68a32410aab56dcd1c9c105adc3ef669de8 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Mon, 18 Oct 2021 13:29:47 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@51917 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 21 +++++++++++++++++++++ src/wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 475608efa7..b558819771 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/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/src/wp-includes/version.php b/src/wp-includes/version.php index 27e14721a9..87b8638c0a 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -23,7 +23,7 @@ $wp_version = '5.9-alpha-51272-src'; * * @global int $wp_db_version */ -$wp_db_version = 49752; +$wp_db_version = 51917; /** * Holds the TinyMCE version.