Ticket #29079: http-args-separated.patch
| File http-args-separated.patch, 2.6 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/theme.php
337 337 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) 338 338 $url = set_url_scheme( $url, 'https' ); 339 339 340 $ args = array(340 $http_args = array( 341 341 'body' => array( 342 342 'action' => $action, 343 343 'request' => serialize( $args ) 344 344 ) 345 345 ); 346 $request = wp_remote_post( $url, $ args );346 $request = wp_remote_post( $url, $http_args ); 347 347 348 348 if ( $ssl && is_wp_error( $request ) ) { 349 349 if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { 350 350 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="https://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 ); 351 351 } 352 $request = wp_remote_post( $http_url, $ args );352 $request = wp_remote_post( $http_url, $http_args ); 353 353 } 354 354 355 355 if ( is_wp_error($request) ) { … … 359 359 if ( ! is_object( $res ) && ! is_array( $res ) ) 360 360 $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="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) ); 361 361 } 362 } else { 363 $http_args = array(); 362 364 } 363 365 364 366 /** … … 366 368 * 367 369 * @since 2.8.0 368 370 * 369 * @param array|object $res WordPress.org Themes API response. 370 * @param string $action Requested action. Likely values are 'theme_information', 371 * 'feature_list', or 'query_themes'. 372 * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API. 371 * @param array|object $res WordPress.org Themes API response. 372 * @param string $action Requested action. Likely values are 'theme_information', 373 * 'feature_list', or 'query_themes'. 374 * @param object $args Arguments used to query for installer pages from the WordPress.org Themes API. 375 * @param array $http_args HTTP request arguments used for native query, if any. 373 376 */ 374 return apply_filters( 'themes_api_result', $res, $action, $args );377 return apply_filters( 'themes_api_result', $res, $action, $args, $http_args ); 375 378 } 376 379 377 380 /**