X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoco.php;h=b4d0f343a2115ea1700ac9c8d3e8285ed6e0c354;hb=e56e543a791289e27b5f0850a85f441773167447;hp=3656571719c94f0c7930812ce14c20e0f95aee4c;hpb=3cef3ab107f87f999cf4adcc909259925a631cea;p=friendica.git diff --git a/mod/poco.php b/mod/poco.php index 3656571719..b4d0f343a2 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -1,6 +1,6 @@ get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) { @@ -121,10 +120,12 @@ function poco_init(App $a) { if (isset($contact['account-type'])) { $contact['contact-type'] = $contact['account-type']; } - $about = DI::cache()->get("about:" . $contact['updated'] . ":" . $contact['nurl']); + + $cacheKey = 'about:' . $contact['nick'] . ':' . DateTimeFormat::utc($contact['updated'], DateTimeFormat::ATOM); + $about = DI::cache()->get($cacheKey); if (is_null($about)) { - $about = BBCode::convert($contact['about'], false); - DI::cache()->set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about); + $about = BBCode::convertForUriId($contact['uri-id'], $contact['about']); + DI::cache()->set($cacheKey, $about); } // Non connected persons can only see the keywords of a Diaspora account @@ -225,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(); } }