diff options
Diffstat (limited to 'actions/friends/remove.php')
-rw-r--r-- | actions/friends/remove.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actions/friends/remove.php b/actions/friends/remove.php index 3d024b9d1..1f3cdcc5b 100644 --- a/actions/friends/remove.php +++ b/actions/friends/remove.php @@ -20,8 +20,14 @@ $errors = false;
// Get the user
- try{
- $_SESSION['user']->removeFriend($friend_guid) && get_class($friend) == "ElggUser";
+ try{ + if ($friend instanceof ElggUser)
+ $_SESSION['user']->removeFriend($friend_guid); + else + { + register_error(sprintf(elgg_echo("friends:remove:failure"),$friend->name)); + $errors = true; + }
} catch (Exception $e) {
register_error(sprintf(elgg_echo("friends:remove:failure"),$friend->name));
$errors = true;
|