More OOP-ish tests using instanceof

This commit is contained in:
Mikael Nordfeldth
2013-10-28 22:18:00 +01:00
parent e4084d0f5a
commit f99c4b7f07
2 changed files with 42 additions and 41 deletions

View File

@@ -1223,9 +1223,9 @@ function common_relative_profile($sender, $nickname, $dt=null)
}
// If this is a local user, try to find a local user with that nickname.
$sender = User::getKV($sender->id);
if ($sender) {
if ($sender instanceof User) {
$recipient_user = User::getKV('nickname', $nickname);
if ($recipient_user) {
if ($recipient_user instanceof User) {
return $recipient_user->getProfile();
}
}