]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ActivityPub/Followers.php
Merge pull request #13093 from annando/emoji-comments
[friendica.git] / src / Module / ActivityPub / Followers.php
index d25e4693c9fd1c39d36be623d30a09b5bb3dceb7..1b9bdbb0f2bb6e5f0cefc356256a50a4580b4956 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
 namespace Friendica\Module\ActivityPub;
 
 use Friendica\BaseModule;
+use Friendica\Core\System;
 use Friendica\Model\Contact;
 use Friendica\Model\User;
 use Friendica\Protocol\ActivityPub;
+use Friendica\Util\HTTPSignature;
 
 /**
  * ActivityPub Followers
  */
 class Followers extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
@@ -43,12 +45,10 @@ class Followers extends BaseModule
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $page = $_REQUEST['page'] ?? null;
+               $page = !empty($request['page']) ? (int)$request['page'] : null;
 
-               $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page);
+               $followers = ActivityPub\Transmitter::getContacts($owner, [Contact::FOLLOWER, Contact::FRIEND], 'followers', $page, (string)HTTPSignature::getSigner('', $_SERVER));
 
-               header('Content-Type: application/activity+json');
-               echo json_encode($followers);
-               exit();
+               System::jsonExit($followers, 'application/activity+json');
        }
 }