Use _http_build_query() if PHP version < 5.1.2. Props hakre. fixes #9044
git-svn-id: https://develop.svn.wordpress.org/trunk@11143 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7a78685b82
commit
bb1a97303f
@ -281,6 +281,9 @@ class WP_Http {
|
||||
$transports = WP_Http::_getTransport($r);
|
||||
} else {
|
||||
if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
|
||||
if ( ! version_compare(phpversion(), '5.1.2', '>=') )
|
||||
$r['body'] = _http_build_query($r['body'], null, '&');
|
||||
else
|
||||
$r['body'] = http_build_query($r['body'], null, '&');
|
||||
$r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset');
|
||||
$r['headers']['Content-Length'] = strlen($r['body']);
|
||||
|
Loading…
Reference in New Issue
Block a user