]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ActivityPub/Outbox.php
Merge pull request #12429 from MrPetovan/bug/contactblock-icon
[friendica.git] / src / Module / ActivityPub / Outbox.php
index c459a55e30e50622550a9afe2d7102d900520130..47ff2a8fc8e840a064997d9879b2dcceb29491f9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,6 +22,7 @@
 namespace Friendica\Module\ActivityPub;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 use Friendica\Model\User;
 use Friendica\Protocol\ActivityPub;
 use Friendica\Util\HTTPSignature;
@@ -31,7 +32,7 @@ use Friendica\Util\HTTPSignature;
  */
 class Outbox extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
@@ -42,12 +43,11 @@ class Outbox extends BaseModule
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $page = $_REQUEST['page'] ?? null;
+               $page = !empty($request['page']) ? (int)$request['page'] : null;
 
                $requester = HTTPSignature::getSigner('', $_SERVER);
                $outbox = ActivityPub\Transmitter::getOutbox($owner, $page, $requester);
-               header('Content-Type: application/activity+json');
-               echo json_encode($outbox);
-               exit();
+
+               System::jsonExit($outbox, 'application/activity+json');
        }
 }