]> git.mxchange.org Git - friendica.git/commitdiff
api_friendships_detroy uid - api_user instead of local_uer, empty check for
authorJonny Tischbein <jonny_tischbein@systemli.org>
Sat, 15 Sep 2018 09:06:55 +0000 (11:06 +0200)
committerJonny Tischbein <jonny_tischbein@systemli.org>
Sat, 15 Sep 2018 09:06:55 +0000 (11:06 +0200)
include/api.php

index 49aa4489b0141ccff6671d5e64166ec9370b0c4e..242f4bc3bb698b5662f67fdd8a2084113f0730bb 100644 (file)
@@ -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");
        }