Make sure something's an int before comparing to -1
This commit is contained in:
		@@ -100,7 +100,7 @@ class Notice extends Memcached_DataObject
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    function getProfile()
 | 
					    function getProfile()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ($this->_profile == -1) {
 | 
					        if (is_int($this->_profile) && $this->_profile == -1) {
 | 
				
			||||||
            $this->_profile = Profile::staticGet('id', $this->profile_id);
 | 
					            $this->_profile = Profile::staticGet('id', $this->profile_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (empty($this->_profile)) {
 | 
					            if (empty($this->_profile)) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,7 @@ class Profile extends Memcached_DataObject
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    function getUser()
 | 
					    function getUser()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ($this->_user == -1) {
 | 
					        if (is_int($this->_user) && $this->_user == -1) {
 | 
				
			||||||
            $this->_user = User::staticGet('id', $this->id);
 | 
					            $this->_user = User::staticGet('id', $this->id);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -80,7 +80,7 @@ class User extends Memcached_DataObject
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    function getProfile()
 | 
					    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);
 | 
					            $this->_profile = Profile::staticGet('id', $this->id);
 | 
				
			||||||
            if (empty($this->_profile)) {
 | 
					            if (empty($this->_profile)) {
 | 
				
			||||||
                throw new UserNoProfileException($this);
 | 
					                throw new UserNoProfileException($this);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user