mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-06 20:48:40 +00:00
Prevent exception of arrays
This commit is contained in:
parent
244e2e8d86
commit
ee018f124f
|
|
@ -131,6 +131,8 @@ final class Response extends ResponseAbstract implements RenderableInterface
|
||||||
$render .= $response->serialize();
|
$render .= $response->serialize();
|
||||||
} elseif (\is_string($response) || \is_numeric($response)) {
|
} elseif (\is_string($response) || \is_numeric($response)) {
|
||||||
$render .= $response;
|
$render .= $response;
|
||||||
|
} elseif (\is_array($response)) {
|
||||||
|
$render .= \json_encode($response);
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Wrong response type');
|
throw new \Exception('Wrong response type');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user