diff options
Diffstat (limited to 'inc/HTTPClient.php')
-rw-r--r-- | inc/HTTPClient.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index 224b32982..b2621bdbb 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -463,6 +463,8 @@ class HTTPClient { } $r_body = $this->_readData($socket, $length, 'response (content-length limited)', true); + }elseif( !isset($this->resp_headers['transfer-encoding']) && $this->max_bodysize && !$this->keep_alive){ + $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true); }else{ // read entire socket $r_size = 0; @@ -806,19 +808,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,'','&'); } /** |