diff --git a/mod/notes.php b/mod/notes.php index 39649d81f6..475e0b7e57 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -45,7 +45,7 @@ function notes_content(App $a, bool $update = false) return; } - $o = BaseProfile::getTabsHTML($a, 'notes', true, $a->getLoggedInUserNickname(), false); + $o = BaseProfile::getTabsHTML('notes', true, $a->getLoggedInUserNickname(), false); if (!$update) { $o .= '

' . DI::l10n()->t('Personal Notes') . '

'; diff --git a/mod/photos.php b/mod/photos.php index 865e0fb318..8bcd9f460c 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -875,7 +875,7 @@ function photos_content(App $a) // tabs $is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid)); - $o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']); + $o .= BaseProfile::getTabsHTML('photos', $is_owner, $user['nickname'], $profile['hide-friends']); // Display upload form if ($datatype === 'upload') { diff --git a/src/Module/BaseProfile.php b/src/Module/BaseProfile.php index 10384e1578..1347ae0df3 100644 --- a/src/Module/BaseProfile.php +++ b/src/Module/BaseProfile.php @@ -32,14 +32,13 @@ class BaseProfile extends BaseModule /** * Returns the HTML for the profile pages tabs * - * @param App $a * @param string $current * @param bool $is_owner * @param string $nickname * @return string * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function getTabsHTML(App $a, string $current, bool $is_owner, string $nickname, bool $hide_friends) + public static function getTabsHTML(string $current, bool $is_owner, string $nickname, bool $hide_friends) { $baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname; diff --git a/src/Module/Profile/Common.php b/src/Module/Profile/Common.php index 6837e0f821..5056758603 100644 --- a/src/Module/Profile/Common.php +++ b/src/Module/Profile/Common.php @@ -61,7 +61,7 @@ class Common extends BaseProfile $a->redirect('profile/' . $nickname . '/contacts'); }; - $o = self::getTabsHTML($a, 'contacts', false, $profile['nickname'], $profile['hide-friends']); + $o = self::getTabsHTML('contacts', false, $profile['nickname'], $profile['hide-friends']); $tabs = self::getContactFilterTabs('profile/' . $nickname, 'common', $displayCommonTab); diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 6397ff4595..5f8363a03d 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -57,7 +57,7 @@ class Contacts extends Module\BaseProfile Nav::setSelected('home'); - $o = self::getTabsHTML($a, 'contacts', $is_owner, $profile['nickname'], $profile['hide-friends']); + $o = self::getTabsHTML('contacts', $is_owner, $profile['nickname'], $profile['hide-friends']); $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId()); diff --git a/src/Module/Profile/Media.php b/src/Module/Profile/Media.php index bae2f9ad86..6c140acce2 100644 --- a/src/Module/Profile/Media.php +++ b/src/Module/Profile/Media.php @@ -44,7 +44,7 @@ class Media extends BaseProfile $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); diff --git a/src/Module/Profile/Photos.php b/src/Module/Profile/Photos.php index 940c1257b2..12c0552b6a 100644 --- a/src/Module/Profile/Photos.php +++ b/src/Module/Profile/Photos.php @@ -72,8 +72,8 @@ class Photos extends \Friendica\Module\BaseProfile throw new HttpException\ForbiddenException($this->t('Public access denied.')); } - $owner = User::getOwnerDataByNick($this->parameters['nickname']); - if (!isset($owner['account_removed']) || $owner['account_removed']) { + $owner = Profile::load($this->app, $this->parameters['nickname'] ?? ''); + if (!$owner || $owner['account_removed'] || $owner['account_expired']) { throw new HTTPException\NotFoundException($this->t('User not found.')); } @@ -174,13 +174,11 @@ class Photos extends \Friendica\Module\BaseProfile ]); } - $this->page['aside'] .= Widget\VCard::getHTML($owner); - if (!empty($photo_albums_widget)) { $this->page['aside'] .= $photo_albums_widget; } - $o = self::getTabsHTML($this->app, 'photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false); + $o = self::getTabsHTML('photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false); $tpl = Renderer::getMarkupTemplate('photos_recent.tpl'); $o .= Renderer::replaceMacros($tpl, [ diff --git a/src/Module/Profile/Profile.php b/src/Module/Profile/Profile.php index 553e9c5231..2c680d4467 100644 --- a/src/Module/Profile/Profile.php +++ b/src/Module/Profile/Profile.php @@ -100,7 +100,7 @@ class Profile extends BaseProfile Nav::setSelected('home'); $is_owner = DI::userSession()->getLocalUserId() == $profile['uid']; - $o = self::getTabsHTML($a, 'profile', $is_owner, $profile['nickname'], $profile['hide-friends']); + $o = self::getTabsHTML('profile', $is_owner, $profile['nickname'], $profile['hide-friends']); $view_as_contacts = []; $view_as_contact_id = 0; diff --git a/src/Module/Profile/Schedule.php b/src/Module/Profile/Schedule.php index 0e1f92018e..10dd5339f8 100644 --- a/src/Module/Profile/Schedule.php +++ b/src/Module/Profile/Schedule.php @@ -58,7 +58,7 @@ class Schedule extends BaseProfile $a = DI::app(); - $o = self::getTabsHTML($a, 'schedule', true, $a->getLoggedInUserNickname(), false); + $o = self::getTabsHTML('schedule', true, $a->getLoggedInUserNickname(), false); $schedule = []; $delayed = DBA::select('delayed-post', [], ['uid' => DI::userSession()->getLocalUserId()]); diff --git a/src/Module/Profile/Status.php b/src/Module/Profile/Status.php index 4b5e567551..0a4a17e462 100644 --- a/src/Module/Profile/Status.php +++ b/src/Module/Profile/Status.php @@ -109,7 +109,7 @@ class Status extends BaseProfile $this->baseUrl->redirect('profile/' . $profile['nickname'] . '/restricted'); } - $o .= self::getTabsHTML($a, 'status', $is_owner, $profile['nickname'], $profile['hide-friends']); + $o .= self::getTabsHTML('status', $is_owner, $profile['nickname'], $profile['hide-friends']); $o .= Widget::commonFriendsVisitor($profile['uid'], $profile['nickname']);