Skip to content

Commit

Permalink
Cron: Remove errant false values in cron array when upgrading to 5.9+.
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
hellofromtonya committed Oct 18, 2021
1 parent 94fb973 commit ac18b68
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @global int $wp_db_version
*/
$wp_db_version = 49752;
$wp_db_version = 51917;

/**
* Holds the TinyMCE version.
Expand Down

0 comments on commit ac18b68

Please sign in to comment.