Ticket #25716: 25716.2.diff
File 25716.2.diff, 8.1 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 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 78 $request = wp_remote_post( $http_url, $args ); 79 } 80 75 81 if ( is_wp_error($request) ) { 76 82 $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 83 } else { -
src/wp-admin/includes/theme.php
282 282 $res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API. 283 283 284 284 if ( ! $res ) { 285 $url = 'http://api.wordpress.org/themes/info/1.0/';286 if ( wp_http_supports( array( 'ssl' ) ) )285 $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/'; 286 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 287 287 $url = set_url_scheme( $url, 'https' ); 288 288 289 $ request = wp_remote_post( $url,array(289 $args = array( 290 290 'body' => array( 291 291 'action' => $action, 292 292 'request' => serialize( $args ) 293 293 ) 294 ) ); 294 ); 295 $request = wp_remote_post( $url, $args ); 295 296 297 if ( $ssl && is_wp_error( $request ) ) { 298 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 299 $request = wp_remote_post( $http_url, $args ); 300 } 301 296 302 if ( is_wp_error($request) ) { 297 303 $res = new WP_Error('themes_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() ); 298 304 } else { -
src/wp-admin/includes/update.php
103 103 function get_core_checksums( $version, $locale ) { 104 104 $return = array(); 105 105 106 $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );106 $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' ); 107 107 108 if ( wp_http_supports( array( 'ssl' ) ) )108 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 109 109 $url = set_url_scheme( $url, 'https' ); 110 110 111 111 $options = array( … … 113 113 ); 114 114 115 115 $response = wp_remote_get( $url, $options ); 116 if ( $ssl && is_wp_error( $response ) ) { 117 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 118 $response = wp_remote_get( $http_url, $options ); 119 } 116 120 117 121 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) 118 122 return false; -
src/wp-includes/update.php
93 93 if ( $extra_stats ) 94 94 $post_body = array_merge( $post_body, $extra_stats ); 95 95 96 $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );97 if ( wp_http_supports( array( 'ssl' ) ) )96 $url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' ); 97 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 98 98 $url = set_url_scheme( $url, 'https' ); 99 99 100 100 $options = array( … … 108 108 ); 109 109 110 110 $response = wp_remote_post( $url, $options ); 111 if ( $ssl && is_wp_error( $response ) ) { 112 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 113 $response = wp_remote_post( $http_url, $options ); 114 } 111 115 112 116 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) 113 117 return false; … … 246 250 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) 247 251 ); 248 252 249 $url = 'http://api.wordpress.org/plugins/update-check/1.1/';250 if ( wp_http_supports( array( 'ssl' ) ) )253 $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/'; 254 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 251 255 $url = set_url_scheme( $url, 'https' ); 252 256 253 257 $raw_response = wp_remote_post( $url, $options ); 258 if ( $ssl && is_wp_error( $raw_response ) ) { 259 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 260 $raw_response = wp_remote_post( $http_url, $options ); 261 } 254 262 255 263 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) 256 264 return false; … … 382 390 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) 383 391 ); 384 392 385 $url = 'http://api.wordpress.org/themes/update-check/1.1/';386 if ( wp_http_supports( array( 'ssl' ) ) )393 $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/'; 394 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 387 395 $url = set_url_scheme( $url, 'https' ); 388 396 389 397 $raw_response = wp_remote_post( $url, $options ); 398 if ( $ssl && is_wp_error( $raw_response ) ) { 399 trigger_error( __( '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>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), E_USER_WARNING ); 400 $raw_response = wp_remote_post( $http_url, $options ); 401 } 390 402 391 403 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) 392 404 return false;