]> git.mxchange.org Git - friendica.git/commitdiff
Twidere reported error 501 when accessing a profile
authorMichael <heluecht@pirati.ca>
Fri, 5 May 2017 20:36:56 +0000 (20:36 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 5 May 2017 20:36:56 +0000 (20:36 +0000)
include/api.php

index 97c09c20a907acf8dc41c2e052bd8bc239f936e3..f68c1bb9e662340b82818eb052de2c2813bb1cd7 100644 (file)
@@ -525,6 +525,15 @@ $called_api = null;
                        }
                }
 
+               if (is_null($user) && x($_GET, 'profileurl')) {
+                       $user = dbesc(normalise_link($_GET['profileurl']));
+                       $nick = $user;
+                       $extra_query = "AND `contact`.`nurl` = '%s' ";
+                       if (api_user() !== false) {
+                               $extra_query .= "AND `contact`.`uid`=".intval(api_user());
+                       }
+               }
+
                if (is_null($user) AND ($a->argc > (count($called_api) - 1)) AND (count($called_api) > 0)) {
                        $argid = count($called_api);
                        list($user, $null) = explode(".", $a->argv[$argid]);
@@ -1400,6 +1409,7 @@ $called_api = null;
 
        /// @TODO move to top of file or somewhere better
        api_register_func('api/users/show','api_users_show');
+       api_register_func('api/externalprofile/show','api_users_show');
 
        function api_users_search($type) {