]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix type conversion warnings caused when calling getUser / getProfile for the second...
authorShashi Gowda <connect2shashi@gmail.com>
Sat, 9 Apr 2011 16:46:52 +0000 (22:16 +0530)
committerShashi Gowda <connect2shashi@gmail.com>
Sat, 9 Apr 2011 16:46:52 +0000 (22:16 +0530)
classes/Notice.php
classes/Profile.php
classes/User.php

index 77415ecaf7e04ea205d263fb08870d49461b7e4e..73d27c815410f51b2b58e2342fa60e407ed2a4ff 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 1f82869bed079a37249d99bd29c04836d6179c45..fb51658aab7170bea3a8762d1605209dc6f241b1 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 68bc612ed71c39069ceb7f9d085e33a9e8f2fcf3..7d556c18c22c7ab6ea1820497881ae9c6280a640 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);