Skip to content

Commit

Permalink
Fix msg error while sending to UCS
Browse files Browse the repository at this point in the history
The fix is based on Bulian version by @idoalit
  • Loading branch information
wynerst authored Mar 9, 2021
1 parent 5cfb3d9 commit 57f2707
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/http_request.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 57f2707

Please sign in to comment.