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.
Built from https://develop.svn.wordpress.org/trunk@48400


git-svn-id: http://core.svn.wordpress.org/trunk@48169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2020-07-07 19:21:06 +00:00
parent 8381fad76e
commit a8521d48ac
2 changed files with 12 additions and 8 deletions

View File

@ -2166,17 +2166,21 @@ function upgrade_530() {
* @since 5.5.0 * @since 5.5.0
*/ */
function upgrade_550() { function upgrade_550() {
global $wp_current_db_version;
update_option( 'finished_updating_comment_type', 0 ); update_option( 'finished_updating_comment_type', 0 );
wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' ); wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );
// Use more clear and inclusive language. if ( $wp_current_db_version < 48121 ) {
$blocklist = get_option( 'blacklist_keys', '' ); // Use more clear and inclusive language.
update_option( 'blocklist_keys', $blocklist ); $blocklist = get_option( 'blacklist_keys', '' );
delete_option( 'blacklist_keys' ); update_option( 'blocklist_keys', $blocklist );
delete_option( 'blacklist_keys' );
$comment_previously_approved = get_option( 'comment_whitelist', '' ); $comment_previously_approved = get_option( 'comment_whitelist', '' );
update_option( 'comment_previously_approved', $comment_previously_approved ); update_option( 'comment_previously_approved', $comment_previously_approved );
delete_option( 'comment_whitelist' ); delete_option( 'comment_whitelist' );
}
} }
/** /**

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-48399'; $wp_version = '5.5-alpha-48400';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.