Avoid inadvertent stomping of the original `$args` parameter passed to `plugins_api_result` and `themes_api_result` filters in `plugins_api()` and `themes_api()`, respectively.

Fixes a regression introduced in [25956].

props Corphi, obenland.
fixes #29079.
Built from https://develop.svn.wordpress.org/trunk@31363


git-svn-id: http://core.svn.wordpress.org/trunk@31344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-02-07 06:21:22 +00:00
parent c8892dfaa2
commit 1e0905793c
3 changed files with 7 additions and 7 deletions

View File

@ -70,18 +70,18 @@ function plugins_api($action, $args = null) {
if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
$args = array(
$http_args = array(
'timeout' => 15,
'body' => array(
'action' => $action,
'request' => serialize( $args )
)
);
$request = wp_remote_post( $url, $args );
$request = wp_remote_post( $url, $http_args );
if ( $ssl && is_wp_error( $request ) ) {
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;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 );
$request = wp_remote_post( $http_url, $args );
$request = wp_remote_post( $http_url, $http_args );
}
if ( is_wp_error($request) ) {

View File

@ -359,19 +359,19 @@ function themes_api( $action, $args = null ) {
if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
$args = array(
$http_args = array(
'body' => array(
'action' => $action,
'request' => serialize( $args )
)
);
$request = wp_remote_post( $url, $args );
$request = wp_remote_post( $url, $http_args );
if ( $ssl && is_wp_error( $request ) ) {
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;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 );
}
$request = wp_remote_post( $http_url, $args );
$request = wp_remote_post( $http_url, $http_args );
}
if ( is_wp_error($request) ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31362';
$wp_version = '4.2-alpha-31363';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.