From fc21e5c76bf6fd6fa8947360b5e6e4b3f26d43de Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Sat, 9 Apr 2011 22:16:52 +0530 Subject: [PATCH] Fix type conversion warnings caused when calling getUser / getProfile for the second time --- classes/Notice.php | 2 +- classes/Profile.php | 2 +- classes/User.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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);