slight rearrangement of getting profile URIs
This commit is contained in:
		@@ -841,28 +841,22 @@ class Profile extends Memcached_DataObject
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        $uri = null;
 | 
					        $uri = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // check for a local user first
 | 
					        // give plugins a chance to set the URI
 | 
				
			||||||
        $user = User::staticGet('id', $this->id);
 | 
					        if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!empty($user)) {
 | 
					            // check for a local user first
 | 
				
			||||||
            $uri = common_local_url(
 | 
					            $user = User::staticGet('id', $this->id);
 | 
				
			||||||
                'userbyid',
 | 
					 | 
				
			||||||
                array('id' => $user->id)
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // give plugins a chance to set the URI
 | 
					 | 
				
			||||||
            if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!empty($user)) {
 | 
				
			||||||
 | 
					                $uri = $user->uri;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
                // return OMB profile if any
 | 
					                // return OMB profile if any
 | 
				
			||||||
                $remote = Remote_profile::staticGet('id', $this->id);
 | 
					                $remote = Remote_profile::staticGet('id', $this->id);
 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (!empty($remote)) {
 | 
					                if (!empty($remote)) {
 | 
				
			||||||
                    $uri = $remote->uri;
 | 
					                    $uri = $remote->uri;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					 | 
				
			||||||
                Event::handle('EndGetProfileUri', array($this, &$uri));
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            Event::handle('EndGetProfileUri', array($this, &$uri));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $uri;
 | 
					        return $uri;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user