]> git.mxchange.org Git - friendica.git/commitdiff
API: fix sender/recipient of PMs
authorfabrixxm <fabrix.xm@gmail.com>
Sun, 17 Jun 2018 17:57:32 +0000 (19:57 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Sun, 17 Jun 2018 17:57:32 +0000 (19:57 +0200)
include/api.php

index af71e2f1cf2693eda373c45167c385106f2fdb9c..6e704cb125a7da7973eae31a44be5f13377457bd 100644 (file)
@@ -3700,11 +3700,6 @@ api_register_func('api/direct_messages/destroy', 'api_direct_messages_destroy',
 function api_direct_messages_box($type, $box, $verbose)
 {
        $a = get_app();
-       $user_info = api_get_user($a);
-
-       if (api_user() === false || $user_info === false) {
-               throw new ForbiddenException();
-       }
 
        // params
        $count = (x($_GET, 'count') ? $_GET['count'] : 20);
@@ -3726,6 +3721,10 @@ function api_direct_messages_box($type, $box, $verbose)
        unset($_REQUEST["screen_name"]);
        unset($_GET["screen_name"]);
 
+       $user_info = api_get_user($a);
+       if (api_user() === false || $user_info === false) {
+               throw new ForbiddenException();
+       }
        $profile_url = $user_info["url"];
 
        // pagination