]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/HCard.php
Merge pull request #12782 from annando/c2s-2
[friendica.git] / src / Module / HCard.php
index cb84c1aa94dec41fc115510e1b1fcd77fb09364a..a6edd5100f5df1cd1b27c00a9d5116ef4956e9c6 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,7 +22,6 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
-use Friendica\Core\Session;
 use Friendica\DI;
 use Friendica\Model\Profile;
 use Friendica\Model\User;
@@ -36,7 +35,7 @@ class HCard extends BaseModule
 {
        protected function content(array $request = []): string
        {
-               if ((local_user()) && ($this->parameters['action'] ?? '') === 'view') {
+               if (DI::userSession()->getLocalUserId() && ($this->parameters['action'] ?? '') === 'view') {
                        // A logged in user views a profile of a user
                        $nickname = DI::app()->getLoggedInUserNickname();
                } elseif (empty($this->parameters['action'])) {
@@ -78,7 +77,7 @@ class HCard extends BaseModule
                        $page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"" . $baseUrl->get() . "/dfrn_{$dfrn}/{$nickname}\" />\r\n";
                }
 
-               $block = (DI::config()->get('system', 'block_public') && !Session::isAuthenticated());
+               $block = (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated());
 
                // check if blocked
                if ($block) {