Unified JSON exit

This commit is contained in:
Michael
2022-04-09 11:58:01 +00:00
parent 344e12c4fc
commit d15023fe4b
21 changed files with 61 additions and 80 deletions

View File

@@ -25,10 +25,10 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Util\XML;
function poco_init(App $a) {
@@ -234,9 +234,7 @@ function poco_init(App $a) {
exit();
}
if ($format === 'json') {
header('Content-type: application/json');
echo json_encode($ret);
exit();
System::jsonExit($ret);
} else {
throw new \Friendica\Network\HTTPException\InternalServerErrorException();
}