Make WordPress Core

Changeset 51917


Ignore:
Timestamp:
10/18/2021 01:29:47 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r51791 r51917  
    833833    }
    834834
     835    if ( $wp_current_db_version < 51917 ) {
     836        upgrade_590();
     837    }
     838
    835839    maybe_disable_link_manager();
    836840
     
    22502254
    22512255/**
     2256 * Executes changes made in WordPress 5.9.0.
     2257 *
     2258 * @ignore
     2259 * @since 5.9.0
     2260 */
     2261function upgrade_590() {
     2262    global $wp_current_db_version;
     2263
     2264    if ( $wp_current_db_version < 51917 ) {
     2265        $crons = _get_cron_array();
     2266        // Remove errant `false` values, see #53950.
     2267        $crons = array_filter( $crons );
     2268        _set_cron_array( $crons );
     2269    }
     2270}
     2271
     2272/**
    22522273 * Executes network-level upgrade routines.
    22532274 *
  • trunk/src/wp-includes/version.php

    r51809 r51917  
    2424 * @global int $wp_db_version
    2525 */
    26 $wp_db_version = 49752;
     26$wp_db_version = 51917;
    2727
    2828/**
Note: See TracChangeset for help on using the changeset viewer.