From: Evan Prodromou Date: Sat, 9 Apr 2011 19:34:33 +0000 (-0400) Subject: Make sure something's an int before comparing to -1 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=070b07632b6490c204b3819eaa4cfe258bf31918;p=quix0rs-gnu-social.git Make sure something's an int before comparing to -1 --- diff --git a/classes/Notice.php b/classes/Notice.php index 1688443301..cf1cfc526b 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 2c15826282..7340af952d 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 48b0f49f3d..6ff856bbaa 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);