Correct the check if user can access the profile
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 22 Mar 2024 11:35:30 +0000 (12:35 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 22 Mar 2024 11:35:30 +0000 (12:35 +0100)
wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php

index e0f852c40ddf8eb3fa101386565fa2998d1bb8f7..5fa4a34a40e7ae5beb387b60c0a7b6c3de8c1450 100644 (file)
@@ -100,9 +100,9 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
         }
 
         /** @see UserProfile::isProtected() */
-        return !$user->getPermission('admin.general.canViewPrivateUserOptions')
-            && !$userProfile->isAccessible('canViewProfile', $user->userID)
-            && $userProfile->userID != $user->userID;
+        return $user->getPermission('admin.general.canViewPrivateUserOptions')
+            || $userProfile->isAccessible('canViewProfile', $user->userID)
+            || $userProfile->userID === $user->userID;
     }
 
     /**