mirror of
https://github.com/friendica/friendica
synced 2025-04-26 18:30:11 +00:00
Unified JSON exit
This commit is contained in:
parent
344e12c4fc
commit
d15023fe4b
21 changed files with 61 additions and 80 deletions
|
@ -339,7 +339,7 @@ class System
|
|||
* @param integer $options JSON options
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function jsonExit($x, $content_type = 'application/json', int $options = 0) {
|
||||
public static function jsonExit($x, $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) {
|
||||
DI::apiResponse()->setType(Response::TYPE_JSON, $content_type);
|
||||
DI::apiResponse()->addContent(json_encode($x, $options));
|
||||
DI::page()->exit(DI::apiResponse()->generate());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue