Make WordPress Core


Ignore:
Timestamp:
09/27/2017 07:59:14 AM (9 years ago)
Author:
dd32
Message:

Standardise on performing api.WordPress.org requests over SSL when possible, falling back to non-SSL when appropriate.
This also standardises the User-Agent used when communicating with WordPress.org, allowing for more consistent version detection.

Fixes #42004.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r40313 r41605  
    449449
    450450        if ( ! $res ) {
     451                // include an unmodified $wp_version
     452                include( ABSPATH . WPINC . '/version.php' );
     453
    451454                $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/';
    452455                if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    … …  
    454457
    455458                $http_args = array(
     459                        'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
    456460                        'body' => array(
    457461                                'action' => $action,
Note: See TracChangeset for help on using the changeset viewer.