Make WordPress Core

Changeset 25308


Ignore:
Timestamp:
09/09/2013 07:53:15 AM (11 years ago)
Author:
dd32
Message:

Switch to using HTTPS connections for Plugin and Theme API requests when SSL is available. See #18577

Location:
trunk/src
Files:
3 edited

Legend:

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

    r25210 r25308  
    4242
    4343    if ( false === $res ) {
    44         $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) );
     44        $url = 'http://api.wordpress.org/plugins/info/1.0/';
     45        if ( wp_http_supports( array( 'ssl' ) ) )
     46            $url = set_url_scheme( $url, 'https' );
     47
     48        $request = wp_remote_post( $url, array(
     49            'timeout' => 15,
     50            'body' => array(
     51                'action' => $action,
     52                'request' => serialize( $args )
     53            )
     54        ) );
     55
    4556        if ( is_wp_error($request) ) {
    4657            $res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
  • trunk/src/wp-admin/includes/theme.php

    r24590 r25308  
    283283
    284284    if ( ! $res ) {
    285         $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) );
     285        $url = 'http://api.wordpress.org/themes/info/1.0/';
     286        if ( wp_http_supports( array( 'ssl' ) ) )
     287            $url = set_url_scheme( $url, 'https' );
     288
     289        $request = wp_remote_post( $url, array(
     290            'body' => array(
     291                'action' => $action,
     292                'request' => serialize( $args )
     293            )
     294        ) );
     295
    286296        if ( is_wp_error($request) ) {
    287297            $res = new WP_Error('themes_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
  • trunk/src/wp-includes/update.php

    r25220 r25308  
    7777
    7878    $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
    79 
    8079    if ( wp_http_supports( array( 'ssl' ) ) )
    8180        $url = set_url_scheme( $url, 'https' );
     
    206205    );
    207206
    208     $raw_response = wp_remote_post('http://api.wordpress.org/plugins/update-check/1.0/', $options);
     207    $url = 'http://api.wordpress.org/plugins/update-check/1.0/';
     208    if ( wp_http_supports( array( 'ssl' ) ) )
     209        $url = set_url_scheme( $url, 'https' );
     210
     211    $raw_response = wp_remote_post( $url, $options );
    209212
    210213    if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
     
    311314    );
    312315
    313     $raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options );
     316    $url = 'http://api.wordpress.org/themes/update-check/1.0/';
     317    if ( wp_http_supports( array( 'ssl' ) ) )
     318        $url = set_url_scheme( $url, 'https' );
     319
     320    $raw_response = wp_remote_post( $url, $options );
    314321
    315322    if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
Note: See TracChangeset for help on using the changeset viewer.