]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/ParseUrl.php
Adding and removing of pictures via API is now possible
[friendica.git] / src / Module / ParseUrl.php
index 91d09240b7e6d39e5b530f3c28fc10643ba17915..e2d75ee8447fd70e2c561a4c5f5a021d26a78541 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;
 
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
-use Friendica\Core\Session;
+use Friendica\Core\L10n;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
 use Friendica\Core\System;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Util;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 class ParseUrl extends BaseModule
 {
+       /** @var IHandleUserSessions */
+       protected $userSession;
+
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = [])
+       {
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->userSession = $userSession;
+       }
+
        protected function rawContent(array $request = [])
        {
-               if (!Session::isAuthenticated()) {
+               if (!$this->userSession->isAuthenticated()) {
                        throw new \Friendica\Network\HTTPException\ForbiddenException();
                }