WordPress.org

Make WordPress Core

Changeset 48400


Ignore:
Timestamp:
07/07/2020 07:19:03 PM (3 months ago)
Author:
desrosj
Message:

Upgrade/Install: Prevent some 5.5.0 upgrade routines from running twice.

This will prevent the options renamed for 5.5.0 from being converted twice. If a new update routine is added before 5.5 is released, the option values would be erased for anyone running trunk or nightlies without this change.

Props azaozz, desrosj, SergeyBiryukov, whyisjake.
Fixes #50413.

File:
1 edited

Legend:

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

    r48122 r48400  
    21672167 */
    21682168function upgrade_550() {
     2169    global $wp_current_db_version;
     2170
    21692171    update_option( 'finished_updating_comment_type', 0 );
    21702172    wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );
    21712173
    2172     // Use more clear and inclusive language.
    2173     $blocklist = get_option( 'blacklist_keys', '' );
    2174     update_option( 'blocklist_keys', $blocklist );
    2175     delete_option( 'blacklist_keys' );
    2176 
    2177     $comment_previously_approved = get_option( 'comment_whitelist', '' );
    2178     update_option( 'comment_previously_approved', $comment_previously_approved );
    2179     delete_option( 'comment_whitelist' );
     2174    if ( $wp_current_db_version < 48121 ) {
     2175        // Use more clear and inclusive language.
     2176        $blocklist = get_option( 'blacklist_keys', '' );
     2177        update_option( 'blocklist_keys', $blocklist );
     2178        delete_option( 'blacklist_keys' );
     2179
     2180        $comment_previously_approved = get_option( 'comment_whitelist', '' );
     2181        update_option( 'comment_previously_approved', $comment_previously_approved );
     2182        delete_option( 'comment_whitelist' );
     2183    }
    21802184}
    21812185
Note: See TracChangeset for help on using the changeset viewer.