Avoid a warning in wp_remote_post() when using arrays or objects in the body param by using a more verbose check, introduced with [22047]. See #14184
git-svn-id: https://develop.svn.wordpress.org/trunk@22055 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6a54459a18
commit
a9f469870d
|
@ -169,7 +169,7 @@ class WP_Http {
|
|||
if ( WP_Http_Encoding::is_available() )
|
||||
$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
|
||||
|
||||
if ( strlen( $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
|
||||
if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
|
||||
if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
|
||||
$r['body'] = http_build_query( $r['body'], null, '&' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue