mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Merge branch 'fix'
This commit is contained in:
@@ -202,14 +202,20 @@ class RequestWrapper implements ApiRequest
|
||||
$contents = $this->getBodyContents();
|
||||
|
||||
if ($this->getContentType() === 'application/json' && $contents) {
|
||||
$this->parsedBody = Json::decode($contents);
|
||||
$parsedBody = Json::decode($contents);
|
||||
|
||||
if (is_array($this->parsedBody)) {
|
||||
$this->parsedBody = (object) [
|
||||
'list' => $this->parsedBody,
|
||||
if (is_array($parsedBody)) {
|
||||
$parsedBody = (object) [
|
||||
'list' => $parsedBody,
|
||||
];
|
||||
}
|
||||
|
||||
if (!$parsedBody instanceof stdClass) {
|
||||
throw new Error("Body is not a JSON object.");
|
||||
}
|
||||
|
||||
$this->parsedBody = $parsedBody;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user