]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Media.php
Apply suggestions from code review
[friendica.git] / src / Module / Profile / Media.php
index e10597199e8ae82c9adf1e048f1c2267e4b5c06e..e2ee1e3d8ac7256245b0bd4eccb32f2cd35a47af 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -29,11 +29,11 @@ use Friendica\Network\HTTPException;
 
 class Media extends BaseProfile
 {
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
-               $profile = ProfileModel::load($a, $parameters['nickname']);
+               $profile = ProfileModel::load($a, $this->parameters['nickname']);
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
@@ -42,9 +42,9 @@ class Media extends BaseProfile
                        DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
                }
 
-               $is_owner = local_user() == $profile['uid'];
+               $is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
 
-               $o = self::getTabsHTML($a, 'media', $is_owner, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('media', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
                $o .= Contact::getPostsFromUrl($profile['url'], false, 0, 0, true);