Make WordPress Core

Changeset 22055


Ignore:
Timestamp:
09/27/2012 10:09:43 AM (12 years ago)
Author:
dd32
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-http.php

    r22047 r22055  
    170170            $r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
    171171
    172         if ( strlen( $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
     172        if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
    173173            if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
    174174                $r['body'] = http_build_query( $r['body'], null, '&' );
Note: See TracChangeset for help on using the changeset viewer.