]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ActivityPub/Inbox.php
Merge pull request #12227 from matthiasmoritz/public_calendar
[friendica.git] / src / Module / ActivityPub / Inbox.php
index 3e0ca1856229606f66e3496fe7f4c3cbc27fd9bd..a9858d94c8d2f77bb1f513708f121db8d421f654 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
  *
@@ -35,7 +35,7 @@ use Friendica\Util\Network;
  */
 class Inbox extends BaseModule
 {
-       public static function rawContent()
+       protected function rawContent(array $request = [])
        {
                $postdata = Network::postdata();
 
@@ -50,12 +50,12 @@ class Inbox extends BaseModule
                                $filename = 'failed-activitypub';
                        }
                        $tempfile = tempnam(System::getTempPath(), $filename);
-                       file_put_contents($tempfile, json_encode(['parameters' => static::$parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
+                       file_put_contents($tempfile, json_encode(['parameters' => $this->parameters, 'header' => $_SERVER, 'body' => $postdata], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
                        Logger::notice('Incoming message stored', ['file' => $tempfile]);
                }
 
-               if (!empty(static::$parameters['nickname'])) {
-                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => static::$parameters['nickname']]);
+               if (!empty($this->parameters['nickname'])) {
+                       $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
                        if (!DBA::isResult($user)) {
                                throw new \Friendica\Network\HTTPException\NotFoundException();
                        }