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
This commit is contained in:
parent
24a33d8181
commit
8aac5ba74e
@ -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 <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) ) {
|
||||
|
@ -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 <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) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user