Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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() );
Note: See TracChangeset for help on using the changeset viewer.