From 070b07632b6490c204b3819eaa4cfe258bf31918 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 9 Apr 2011 15:34:33 -0400 Subject: [PATCH] Make sure something's an int before comparing to -1 --- 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 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); -- 2.39.5