Make WordPress Core

Changeset 60428


Ignore:
Timestamp:
07/07/2025 08:32:46 PM (8 days ago)
Author:
jorbin
Message:

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.

Reviewed by audrasjb.
Merges [60421] and [60422] to the 6.8 branch.

Props sabernhardt, peterwilsoncc, jorbin, bhubbard, matt.
Fixes #42007.

Location:
branches/6.8
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/6.8

  • branches/6.8/src/wp-admin/includes/schema.php

    r59798 r60428  
    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,
  • branches/6.8/src/wp-admin/includes/upgrade.php

    r59861 r60428  
    882882        upgrade_670();
    883883    }
     884
     885    if ( $wp_current_db_version < 60421 ) {
     886        upgrade_682();
     887    }
     888
    884889    maybe_disable_link_manager();
    885890
     
    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 */
     2456function 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.
  • branches/6.8/src/wp-includes/version.php

    r60210 r60428  
    2424 * @global int $wp_db_version
    2525 */
    26 $wp_db_version = 58975;
     26$wp_db_version = 60421;
    2727
    2828/**
  • branches/6.8/tests/phpunit/tests/option/sanitizeOption.php

    r56547 r60428  
    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 ),
Note: See TracChangeset for help on using the changeset viewer.