The own user profile should be always accessible
authorAlexander Ebert <ebert@woltlab.com>
Mon, 2 Jul 2018 12:03:49 +0000 (14:03 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 2 Jul 2018 12:03:49 +0000 (14:03 +0200)
wcfsetup/install/files/lib/data/user/UserProfile.class.php

index c4eb5c5c0ff714847d23bd79c1b4d3849b060617..e1ccf77a014509c114ec73a366526a20295d145e 100644 (file)
@@ -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: