aboutsummaryrefslogtreecommitdiff
path: root/actions/friends/add.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/friends/add.php')
-rw-r--r--actions/friends/add.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/actions/friends/add.php b/actions/friends/add.php
index c464a8162..e6efe1db1 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -26,7 +26,13 @@ if(check_entity_relationship($friend->guid, "friendrequest", $user->guid)
if (!$user->addFriend($friend_guid)) {
$errors = true;
}
- remove_entity_relationship($friend->guid, "friendrequest", $user->guid);
+
+ $ia = elgg_set_ignore_access(true);
+ $friend->addFriend($user->guid);
+ elgg_set_ignore_access($ia);
+
+ remove_entity_relationship($friend->guid, "friendrequest", $user->guid);
+
} catch (Exception $e) {
register_error(elgg_echo("friends:add:failure", array($friend->name)));
$errors = true;