From 5ee63d35f729b08f528b230b47c0a9bc698153ee Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Sat, 30 Jul 2022 17:43:16 -0500 Subject: [PATCH 1/4] Use HTTPS for rpc.pingomatic.com --- src/wp-admin/includes/schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index 011895f06c466..6c15a4d99ffbc 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -446,7 +446,7 @@ function populate_options( array $options = array() ) { 'moderation_keys' => '', 'active_plugins' => array(), 'category_base' => '', - 'ping_sites' => 'http://rpc.pingomatic.com/', + 'ping_sites' => 'https://rpc.pingomatic.com/', 'comment_max_links' => 2, 'gmt_offset' => $gmt_offset, From bc1f2a6db2f058102a8336f6318eff43ae4fbad3 Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Sat, 30 Jul 2022 18:02:41 -0500 Subject: [PATCH 2/4] Update unit test to check both HTTP and HTTPS --- tests/phpunit/tests/option/sanitizeOption.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/phpunit/tests/option/sanitizeOption.php b/tests/phpunit/tests/option/sanitizeOption.php index b4f8293041e3f..68597b8acdaea 100644 --- a/tests/phpunit/tests/option/sanitizeOption.php +++ b/tests/phpunit/tests/option/sanitizeOption.php @@ -43,6 +43,7 @@ public function data_sanitize_option() { array( 'date_format', 'F j, Y', 'F j, Y' ), array( 'date_format', 'F j, Y', 'F j, Y' ), array( 'ping_sites', 'http://rpc.pingomatic.com/', 'http://rpc.pingomatic.com/' ), + array( 'ping_sites', 'https://rpc.pingomatic.com/', 'https://rpc.pingomatic.com/' ), array( 'ping_sites', "http://www.example.com\nhttp://example.org", "www.example.com \n\texample.org\n\n" ), array( 'gmt_offset', '0', 0 ), array( 'gmt_offset', '1.5', '1.5' ), From 0156113b954a9cfd4134f6c4e0a9d099bc01902a Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Jun 2025 08:10:31 +1000 Subject: [PATCH 3/4] Upgrade routine: pingomatic URLs to use HTTPS. --- src/wp-admin/includes/upgrade.php | 38 +++++++++++++++++++++++++++++++ src/wp-includes/version.php | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index a3c7260a04956..ffd7c205a50d1 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -881,6 +881,11 @@ function upgrade_all() { if ( $wp_current_db_version < 58975 ) { upgrade_670(); } + + if ( $wp_current_db_version < 60344 ) { + upgrade_682(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2439,6 +2444,39 @@ 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 < 60344 ) { + // Upgrade pingomatic URLs 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( $url, '://rpc.pingomatic.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. * diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index 324ee3279f8ca..b8e35ea93465b 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -23,7 +23,7 @@ * * @global int $wp_db_version */ -$wp_db_version = 58975; +$wp_db_version = 60344; /** * Holds the TinyMCE version. From df99dafa64bfe3b76f2fa6682d3e27e7097407f5 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Fri, 27 Jun 2025 09:50:45 +1000 Subject: [PATCH 4/4] Update rpc.twingly.com to use https in upgrade routine. --- src/wp-admin/includes/upgrade.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index ffd7c205a50d1..8b1f761f59bfb 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -2457,14 +2457,17 @@ function upgrade_682() { global $wp_current_db_version; if ( $wp_current_db_version < 60344 ) { - // Upgrade pingomatic URLs to use HTTPS. + // 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( $url, '://rpc.pingomatic.com/' ) ) { + 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;