WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r25691 r25957  
    6161
    6262    if ( false === $res ) {
    63         $url = 'http://api.wordpress.org/plugins/info/1.0/';
    64         if ( wp_http_supports( array( 'ssl' ) ) )
     63        $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
     64        if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    6565            $url = set_url_scheme( $url, 'https' );
    6666
    67         $request = wp_remote_post( $url, array(
     67        $args = array(
    6868            'timeout' => 15,
    6969            'body' => array(
     
    7171                'request' => serialize( $args )
    7272            )
    73         ) );
     73        );
     74        $request = wp_remote_post( $url, $args );
     75
     76        if ( $ssl && is_wp_error( $request ) ) {
     77            trigger_error( __( '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>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     78            $request = wp_remote_post( $http_url, $args );
     79        }
    7480
    7581        if ( is_wp_error($request) ) {
Note: See TracChangeset for help on using the changeset viewer.