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) {
if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
Logger::info("End of poco");
- if ($format === 'xml') {
- header('Content-type: text/xml');
- echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret]));
- exit();
- }
if ($format === 'json') {
- header('Content-type: application/json');
- echo json_encode($ret);
- exit();
+ System::jsonExit($ret);
} else {
- throw new \Friendica\Network\HTTPException\InternalServerErrorException();
+ throw new \Friendica\Network\HTTPException\UnsupportedMediaTypeException();
}
}