From a0942963c9f3881c61c05b4c6b9943f6ebf4d686 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Sat, 15 Sep 2018 11:06:55 +0200 Subject: [PATCH] api_friendships_detroy uid - api_user instead of local_uer, empty check for --- include/api.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/api.php b/include/api.php index 49aa4489b0..242f4bc3bb 100644 --- a/include/api.php +++ b/include/api.php @@ -3640,17 +3640,15 @@ api_register_func('api/direct_messages/destroy', 'api_direct_messages_destroy', */ function api_friendships_destroy($type) { - $a = api_user(); + $uid = api_user(); - if ($a === false) { + if ($uid === false) { throw new ForbiddenException(); } - $uid = local_user(); - $contact_id = defaults($_REQUEST, 'user_id'); - if ($contact_id == null) { + if (empty($contact_id)) { logger("No user_id specified", LOGGER_DEBUG); throw new BadRequestException("no user_id specified"); }