diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-08-01 22:08:23 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-08-01 22:09:09 +0200 |
commit | 4d4b1f8c22cf406b35a88c7299f8ee2bc033bf4d (patch) | |
tree | 0157fc6f9315c9d8b3d9e2f92eed52397d12f1ac /inc/HTTPClient.php | |
parent | 991a5ddd298562a9b0e37df25cb7e682519ccf7a (diff) | |
download | rpg-4d4b1f8c22cf406b35a88c7299f8ee2bc033bf4d.tar.gz rpg-4d4b1f8c22cf406b35a88c7299f8ee2bc033bf4d.tar.bz2 |
use http_build_query() in HTTPClient
this ensures nested POST data is correctly encoded
Diffstat (limited to 'inc/HTTPClient.php')
-rw-r--r-- | inc/HTTPClient.php | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 224b32982..3964c8fbc 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -806,19 +806,7 @@ class HTTPClient { * @author Andreas Gohr <andi@splitbrain.org> */ function _postEncode($data){ - $url = ''; - foreach($data as $key => $val){ - if (is_array($val)) { - foreach ($val as $k => $v) { - if($url) $url .= '&'; - $url .= urlencode($key).'['.$k.']='.urlencode($v); - } - } else { - if($url) $url .= '&'; - $url .= urlencode($key).'='.urlencode($val); - } - } - return $url; + return http_build_query($data,'','&'); } /** |