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

git-svn-id: https://develop.svn.wordpress.org/trunk@25308 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2013-09-09 07:53:15 +00:00
parent 30827b47c1
commit 4a56e07c75
3 changed files with 33 additions and 5 deletions

View File

@@ -76,7 +76,6 @@ function wp_version_check() {
);
$url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
if ( wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
@@ -205,7 +204,11 @@ function wp_update_plugins() {
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$raw_response = wp_remote_post('http://api.wordpress.org/plugins/update-check/1.0/', $options);
$url = 'http://api.wordpress.org/plugins/update-check/1.0/';
if ( wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
$raw_response = wp_remote_post( $url, $options );
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
return false;
@@ -310,7 +313,11 @@ function wp_update_themes() {
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options );
$url = 'http://api.wordpress.org/themes/update-check/1.0/';
if ( wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
$raw_response = wp_remote_post( $url, $options );
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
return false;