Skip to content

Commit 1228a1e

Browse files
committed
Pings/Trackbacks: Use HTTPS for services that now support it.
This updates the default on new installations for rpc.pingomatic.com to use https while also upgrading existing sites that use rpc.pingomatic.com or rpc.twingly.com to use https for those two domains. Props sabernhardt, peterwilsoncc, jorbin, bhubbard, matt. Fixes #42007. git-svn-id: https://develop.svn.wordpress.org/trunk@60421 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2deede3 commit 1228a1e

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

src/wp-admin/includes/schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function populate_options( array $options = array() ) {
446446
'moderation_keys' => '',
447447
'active_plugins' => array(),
448448
'category_base' => '',
449-
'ping_sites' => 'http://rpc.pingomatic.com/',
449+
'ping_sites' => 'https://rpc.pingomatic.com/',
450450
'comment_max_links' => 2,
451451
'gmt_offset' => $gmt_offset,
452452

src/wp-admin/includes/upgrade.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,11 @@ function upgrade_all() {
881881
if ( $wp_current_db_version < 58975 ) {
882882
upgrade_670();
883883
}
884+
885+
if ( $wp_current_db_version < 60421 ) {
886+
upgrade_682();
887+
}
888+
884889
maybe_disable_link_manager();
885890

886891
maybe_disable_automattic_widgets();
@@ -2439,6 +2444,42 @@ function upgrade_670() {
24392444
wp_set_options_autoload( $options, false );
24402445
}
24412446
}
2447+
2448+
/**
2449+
* Executes changes made in WordPress 6.8.2.
2450+
*
2451+
* @ignore
2452+
* @since 6.8.2
2453+
*
2454+
* @global int $wp_current_db_version The old (current) database version.
2455+
*/
2456+
function upgrade_682() {
2457+
global $wp_current_db_version;
2458+
2459+
if ( $wp_current_db_version < 60421 ) {
2460+
// Upgrade Ping-O-Matic and Twingly to use HTTPS.
2461+
$ping_sites_value = get_option( 'ping_sites' );
2462+
$ping_sites_value = explode( "\n", $ping_sites_value );
2463+
$ping_sites_value = array_map(
2464+
function ( $url ) {
2465+
$url = trim( $url );
2466+
$url = sanitize_url( $url );
2467+
if (
2468+
str_ends_with( trailingslashit( $url ), '://rpc.pingomatic.com/' )
2469+
|| str_ends_with( trailingslashit( $url ), '://rpc.twingly.com/' )
2470+
) {
2471+
$url = set_url_scheme( $url, 'https' );
2472+
}
2473+
return $url;
2474+
},
2475+
$ping_sites_value
2476+
);
2477+
$ping_sites_value = array_filter( $ping_sites_value );
2478+
$ping_sites_value = implode( "\n", $ping_sites_value );
2479+
update_option( 'ping_sites', $ping_sites_value );
2480+
}
2481+
}
2482+
24422483
/**
24432484
* Executes network-level upgrade routines.
24442485
*

src/wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @global int $wp_db_version
2525
*/
26-
$wp_db_version = 58975;
26+
$wp_db_version = 60344;
2727

2828
/**
2929
* Holds the TinyMCE version.

tests/phpunit/tests/option/sanitizeOption.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function data_sanitize_option() {
4343
array( 'date_format', 'F j, Y', 'F j, Y' ),
4444
array( 'date_format', 'F j, Y', 'F j, <strong>Y</strong>' ),
4545
array( 'ping_sites', 'http://rpc.pingomatic.com/', 'http://rpc.pingomatic.com/' ),
46+
array( 'ping_sites', 'https://rpc.pingomatic.com/', 'https://rpc.pingomatic.com/' ),
4647
array( 'ping_sites', "http://www.example.com\nhttp://example.org", "www.example.com \n\texample.org\n\n" ),
4748
array( 'gmt_offset', '0', 0 ),
4849
array( 'gmt_offset', '1.5', '1.5' ),

0 commit comments

Comments
 (0)