]> git.mxchange.org Git - friendica.git/blobdiff - mod/poco.php
Merge pull request #12001 from tobiasd/20221016-docsmysql
[friendica.git] / mod / poco.php
index 1ccd74b7f1dda1f7fd44fa5a08b8af4ebd852419..b4d0f343a2115ea1700ac9c8d3e8285ed6e0c354 100644 (file)
@@ -24,12 +24,10 @@ use Friendica\App;
 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'))) {
@@ -228,16 +226,9 @@ function poco_init(App $a) {
 
        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();
        }
 }