diff --git a/lib/http_request.inc.php b/lib/http_request.inc.php index 6e9e96cf..c533b5c8 100755 --- a/lib/http_request.inc.php +++ b/lib/http_request.inc.php @@ -186,6 +186,16 @@ public function send_http_request($url, $referer, $data, $method = 'POST', $cont $result = explode("\r\n\r\n", $result, 2); $this->headers = isset($result[0]) ? $result[0] : ''; - $this->body = isset($result[1]) ? $result[1] : ''; + $this->body = $this->decode_chunked(isset($result[1]) ? $result[1] : ''); + } + + function decode_chunked($str) { + for ($res = ''; !empty($str); $str = trim($str)) { + $pos = strpos($str, "\r\n"); + $len = hexdec(substr($str, 0, $pos)); + $res.= substr($str, $pos + 2, $len); + $str = substr($str, $pos + 2 + $len); + } + return $res; } }