From 39ce33f7ed616a2283071a2bed4340695905a29e Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 29 Nov 2018 15:06:00 +0000 Subject: [PATCH] Issue 6212: No need of a redirect for fetching content --- mod/display.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mod/display.php b/mod/display.php index 39661cb76f..1bb2a6ec81 100644 --- a/mod/display.php +++ b/mod/display.php @@ -82,7 +82,16 @@ function display_init(App $a) } if (ActivityPub::isRequest()) { - $a->internalRedirect(str_replace('display/', 'objects/', $a->query_string)); + $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'origin' => true, 'private' => false]); + if (!DBA::isResult($item)) { + System::httpExit(404); + } + + $data = ActivityPub\Transmitter::createObjectFromItemID($item['id']); + + header('Content-Type: application/activity+json'); + echo json_encode($data); + exit(); } if ($item["id"] != $item["parent"]) {