]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make sure something's an int before comparing to -1
authorEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 19:34:33 +0000 (15:34 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 19:34:33 +0000 (15:34 -0400)
classes/Notice.php
classes/Profile.php
classes/User.php

index 168844330193f537b4f6d8d7c5d1b1979388e365..cf1cfc526b3c2abab79cc396a7f99e1c95241e69 100644 (file)
@@ -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)) {
index 2c1582628242b959f818aba15251104d81ea716c..7340af952d344ca1df9b015571510a23cf90cc93 100644 (file)
@@ -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);
         }
 
index 48b0f49f3da93e9802031e8ef5f39cf6c8a369fe..6ff856bbaa4e05f77863a07b8d600bd8f50f94da 100644 (file)
@@ -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);