From 8aac5ba74ec4d861013b7e30cf7f6e533150bbc1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 7 Feb 2015 06:20:42 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@31363 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/plugin-install.php | 6 +++--- src/wp-admin/includes/theme.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php index f9b487add1..8d3ee90ec0 100644 --- a/src/wp-admin/includes/plugin-install.php +++ b/src/wp-admin/includes/plugin-install.php @@ -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’s configuration. If you continue to have problems, please try the support forums.' ) . ' ' . __( '(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) ) { diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index 2c3a8276d6..2984218bf8 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -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’s configuration. If you continue to have problems, please try the support forums.' ) . ' ' . __( '(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) ) {