From: Martin Lyth Date: Sat, 2 Jul 2016 21:02:37 +0000 (-0400) Subject: Check if we're the current user before retrieving X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c9afdae01ccf48d1456be3f98b257d6f18097882;p=quix0rs-gnu-social.git Check if we're the current user before retrieving --- diff --git a/classes/Profile.php b/classes/Profile.php index ef3f5c1b2f..b557e3088c 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -89,13 +89,14 @@ class Profile extends Managed_DataObject public function getUser() { if (!isset($this->_user[$this->id])) { - $user = User::getKV('id', $this->id); - if (!$user instanceof User) { - throw new NoSuchUserException(array('id'=>$this->id)); - } $cur_user = common_current_user(); if (($cur_user instanceof User) && $cur_user->sameAS($this)) { $user = $cur_user; + } else { + $user = User::getKV('id', $this->id); + if (!$user instanceof User) { + throw new NoSuchUserException(array('id'=>$this->id)); + } } $this->_user[$this->id] = $user; }