Closed
Description
The condition in the getJsonRawBody()
method looks like this:
cphalcon/phalcon/http/request.zep
Lines 403 to 406 in 0a24d8d
getRawBody()
method looks like this:
cphalcon/phalcon/http/request.zep
Lines 382 to 393 in 0a24d8d
file_get_contents("php://input")
always return string, so the condition if typeof rawBody != "string"
is never satisfied.
I think the getJsonRawBody()
method should look like this:
public function getJsonRawBody(boolean associative = false) -> <\stdClass> | array | boolean
{
var rawBody, data;
let rawBody = this->getRawBody();
if rawBody === "" {
return false;
}
let data = json_decode(rawBody, associative);
if json_last_error() !== JSON_ERROR_NONE {
return false;
}
return data;
}