]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Test user equality better in Profile->getUser()
authorMartin Lyth <bsfmartini@gmail.com>
Sat, 2 Jul 2016 19:45:42 +0000 (15:45 -0400)
committerMartin Lyth <bsfmartini@gmail.com>
Sat, 2 Jul 2016 19:45:42 +0000 (15:45 -0400)
classes/Profile.php

index a38ee9f499107afab6317947b951164655abf02b..ef3f5c1b2fdec565a321eb000d3e81653cf0e722 100644 (file)
@@ -94,7 +94,7 @@ class Profile extends Managed_DataObject
                 throw new NoSuchUserException(array('id'=>$this->id));
             }
             $cur_user = common_current_user();
-            if ($user->id === $cur_user->id) {
+            if (($cur_user instanceof User) && $cur_user->sameAS($this)) {
                 $user = $cur_user;
             }
             $this->_user[$this->id] = $user;