WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/09/2013 07:53:15 AM (6 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/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() );
Note: See TracChangeset for help on using the changeset viewer.