Template based XML generation is replaced with native XML

This commit is contained in:
Michael 2022-09-11 07:00:16 +00:00
parent 2123b4d071
commit ff89c1a8bf
9 changed files with 222 additions and 174 deletions

View file

@ -24,13 +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\Module\Response;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\XML;
function poco_init(App $a) {
if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
@ -229,12 +226,9 @@ function poco_init(App $a) {
Logger::info("End of poco");
if ($format === 'xml') {
System::httpExit(Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret])), Response::TYPE_XML);
}
if ($format === 'json') {
System::jsonExit($ret);
} else {
throw new \Friendica\Network\HTTPException\InternalServerErrorException();
throw new \Friendica\Network\HTTPException\UnsupportedMediaTypeException();
}
}