]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ActivityPub/Following.php
Merge pull request #13090 from abanink/feature-openwebauth
[friendica.git] / src / Module / ActivityPub / Following.php
index 67d3010a3a68564e569c4a8c0a941d3b47f1c908..ae2709611798fc0ead0e1d7967de35fed4fb1082 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, 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\Contact;
 use Friendica\Model\User;
 use Friendica\Protocol\ActivityPub;
@@ -42,12 +43,10 @@ class Following extends BaseModule
                        throw new \Friendica\Network\HTTPException\NotFoundException();
                }
 
-               $page = $_REQUEST['page'] ?? null;
+               $page = !empty($request['page']) ? (int)$request['page'] : null;
 
                $following = ActivityPub\Transmitter::getContacts($owner, [Contact::SHARING, Contact::FRIEND], 'following', $page);
 
-               header('Content-Type: application/activity+json');
-               echo json_encode($following);
-               exit();
+               System::jsonExit($following, 'application/activity+json');
        }
 }