Ticket #25716: 25716.diff
File 25716.diff, 1.3 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/plugin-install.php
60 60 $res = apply_filters( 'plugins_api', false, $action, $args ); 61 61 62 62 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' ) ) ) 65 65 $url = set_url_scheme( $url, 'https' ); 66 66 67 $ request = wp_remote_post( $url,array(67 $args = array( 68 68 'timeout' => 15, 69 69 'body' => array( 70 70 'action' => $action, 71 71 'request' => serialize( $args ) 72 72 ) 73 ) ); 73 ); 74 $request = wp_remote_post( $url, $args ); 74 75 76 if ( $ssl && is_wp_error( $request ) ) 77 $request = wp_remote_post( $http_url, $args ); 78 75 79 if ( is_wp_error($request) ) { 76 80 $res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() ); 77 81 } else {