From bb1a97303f7f398ad3cc41f5c9b811dcbd19ae8a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 30 Apr 2009 21:51:16 +0000 Subject: [PATCH] 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 --- wp-includes/http.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 351eef24f0..e12fd02795 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -281,7 +281,10 @@ class WP_Http { $transports = WP_Http::_getTransport($r); } else { if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { - $r['body'] = http_build_query($r['body'], null, '&'); + 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']); }