name))); forward(REFERER); } if(check_entity_relationship($user->guid, "friend", $friend->guid)) { try { $user->removeFriend($friend->guid); if(check_entity_relationship($friend->guid, "friend", $user->guid)){ $friend->removeFriend($user->guid); } } catch (Exception $e) { register_error(elgg_echo('friends:remove:failure', array($friend->name))); forward(REFERER); } } system_message(elgg_echo('friends:remove:successful', array($friend->name))); forward(REFERER);