aboutsummaryrefslogtreecommitdiff
path: root/actions/friends
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-30 12:15:39 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-30 12:15:39 +0000
commitfc11bcffa66e2baaae52261a84de13802bb1f072 (patch)
tree4eb0a28e6d836ca17d8486ff68d753202b11d402 /actions/friends
parent96713356dc066fc039b445dcf92d874a47d871f0 (diff)
downloadelgg-fc11bcffa66e2baaae52261a84de13802bb1f072.tar.gz
elgg-fc11bcffa66e2baaae52261a84de13802bb1f072.tar.bz2
Closes #388: Additionally the site check in configuration_init() should be instanceof. Nice spot, thanks.
git-svn-id: https://code.elgg.org/elgg/trunk@2151 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/friends')
-rw-r--r--actions/friends/remove.php10
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;