Switch to using HTTPS connections for Plugin and Theme API requests when SSL is available. See #18577
Built from https://develop.svn.wordpress.org/trunk@25308 git-svn-id: http://core.svn.wordpress.org/trunk@25270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -41,7 +41,18 @@ function plugins_api($action, $args = null) {
|
||||
$res = apply_filters('plugins_api', false, $action, $args);
|
||||
|
||||
if ( false === $res ) {
|
||||
$request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) );
|
||||
$url = 'http://api.wordpress.org/plugins/info/1.0/';
|
||||
if ( wp_http_supports( array( 'ssl' ) ) )
|
||||
$url = set_url_scheme( $url, 'https' );
|
||||
|
||||
$request = wp_remote_post( $url, array(
|
||||
'timeout' => 15,
|
||||
'body' => array(
|
||||
'action' => $action,
|
||||
'request' => serialize( $args )
|
||||
)
|
||||
) );
|
||||
|
||||
if ( is_wp_error($request) ) {
|
||||
$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() );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user