]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/DFRN/Notify.php
Merge pull request #12663 from nupplaphil/sec/xss_404
[friendica.git] / src / Module / DFRN / Notify.php
index 32c11beb77189b65ec5f4221b657ada6b758a5d8..6001ae6dc02de2183e8f2c171eed4ae73ede998d 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
  *
 
 namespace Friendica\Module\DFRN;
 
+use Friendica\App;
 use Friendica\BaseModule;
+use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
+use Friendica\Database\Database;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Model\User;
+use Friendica\Module\OStatus\Salmon;
+use Friendica\Module\Response;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\Diaspora;
 use Friendica\Util\Network;
 use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * DFRN Notify
  */
 class Notify extends BaseModule
 {
+       /** @var Database */
+       private $database;
+
+       public function __construct(Database $database, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->database = $database;
+       }
+
        protected function post(array $request = [])
        {
                $postdata = Network::postdata();
@@ -53,9 +70,8 @@ class Notify extends BaseModule
                                throw new \Friendica\Network\HTTPException\InternalServerErrorException();
                        }
                        $this->dispatchPrivate($user, $postdata);
-               } elseif (!$this->dispatchPublic($postdata)) {
-                       require_once 'mod/salmon.php';
-                       salmon_post(DI::app(), $postdata);
+               } else {
+                       $this->dispatchPublic($postdata);
                }
        }