diff options
Diffstat (limited to 'src/wp-admin/includes/upgrade.php')
-rw-r--r-- | src/wp-admin/includes/upgrade.php | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index d8d3248edb..9b91ef5762 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -208,7 +208,7 @@ if ( ! function_exists( 'wp_install_defaults' ) ) : // First post. $now = current_time( 'mysql' ); - $now_gmt = current_time( 'mysql', 1 ); + $now_gmt = current_time( 'mysql', true ); $first_post_guid = get_option( 'home' ) . '/?p=1'; if ( is_multisite() ) { @@ -881,6 +881,11 @@ function upgrade_all() { if ( $wp_current_db_version < 58975 ) { upgrade_670(); } + + if ( $wp_current_db_version < 60421 ) { + upgrade_682(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2439,6 +2444,42 @@ function upgrade_670() { wp_set_options_autoload( $options, false ); } } + +/** + * Executes changes made in WordPress 6.8.2. + * + * @ignore + * @since 6.8.2 + * + * @global int $wp_current_db_version The old (current) database version. + */ +function upgrade_682() { + global $wp_current_db_version; + + if ( $wp_current_db_version < 60421 ) { + // Upgrade Ping-O-Matic and Twingly to use HTTPS. + $ping_sites_value = get_option( 'ping_sites' ); + $ping_sites_value = explode( "\n", $ping_sites_value ); + $ping_sites_value = array_map( + function ( $url ) { + $url = trim( $url ); + $url = sanitize_url( $url ); + if ( + str_ends_with( trailingslashit( $url ), '://rpc.pingomatic.com/' ) + || str_ends_with( trailingslashit( $url ), '://rpc.twingly.com/' ) + ) { + $url = set_url_scheme( $url, 'https' ); + } + return $url; + }, + $ping_sites_value + ); + $ping_sites_value = array_filter( $ping_sites_value ); + $ping_sites_value = implode( "\n", $ping_sites_value ); + update_option( 'ping_sites', $ping_sites_value ); + } +} + /** * Executes network-level upgrade routines. * |