From 05faa298759b31d3d39100c7e7eb1cad51eea3d9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 2 Jul 2018 14:03:49 +0200 Subject: [PATCH] The own user profile should be always accessible --- .../files/lib/data/user/UserProfile.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index c4eb5c5c0f..e1ccf77a01 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -598,7 +598,17 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject { break; case self::ACCESS_FOLLOWING: - $data['result'] = ($this->isFollowing(WCF::getUser()->userID) ? true : false); + $result = false; + if (WCF::getUser()->userID) { + if (WCF::getUser()->userID == $this->userID) { + $result = true; + } + else if ($this->isFollowing(WCF::getUser()->userID)) { + $result = true; + } + } + + $data['result'] = $result; break; case self::ACCESS_NOBODY: -- 2.20.1