From: Shashi Gowda Date: Sat, 9 Apr 2011 16:46:52 +0000 (+0530) Subject: Fix type conversion warnings caused when calling getUser / getProfile for the second... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc21e5c76bf6fd6fa8947360b5e6e4b3f26d43de;p=quix0rs-gnu-social.git Fix type conversion warnings caused when calling getUser / getProfile for the second time --- diff --git a/classes/Notice.php b/classes/Notice.php index 77415ecaf7..73d27c8154 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -100,7 +100,7 @@ class Notice extends Memcached_DataObject function getProfile() { - if ($this->_profile == -1) { + if (is_int($this->_profile) && $this->_profile == -1) { $this->_profile = Profile::staticGet('id', $this->profile_id); if (empty($this->_profile)) { diff --git a/classes/Profile.php b/classes/Profile.php index 1f82869bed..fb51658aab 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -56,7 +56,7 @@ class Profile extends Memcached_DataObject function getUser() { - if ($this->_user == -1) { + if (is_int($this->_user) && $this->_user == -1) { $this->_user = User::staticGet('id', $this->id); } diff --git a/classes/User.php b/classes/User.php index 68bc612ed7..7d556c18c2 100644 --- a/classes/User.php +++ b/classes/User.php @@ -80,7 +80,7 @@ class User extends Memcached_DataObject */ function getProfile() { - if ($this->_profile == -1) { // invalid but distinct from null + if (is_int($this->_profile) && $this->_profile == -1) { // invalid but distinct from null $this->_profile = Profile::staticGet('id', $this->id); if (empty($this->_profile)) { throw new UserNoProfileException($this);