From 3d3ad07385e3a29a6ffc79c2cd0d461e6be29f0b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 9 Aug 2020 09:09:38 -0400 Subject: [PATCH] Enable profile contacts page for profile owner --- src/Module/Profile/Contacts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 6981b43a4..afa2e4448 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -51,14 +51,14 @@ class Contacts extends Module\BaseProfile throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); } - if (!empty($a->profile['hide-friends'])) { + $is_owner = $a->profile['uid'] == local_user(); + + if (!empty($a->profile['hide-friends']) && !$is_owner) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); } Nav::setSelected('home'); - $is_owner = $a->profile['uid'] == local_user(); - $o = self::getTabsHTML($a, 'contacts', $is_owner, $nickname); $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, Session::isAuthenticated() && $a->profile['uid'] != local_user());