]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Fix overly strict return value for revokeFollow methods
[friendica.git] / src / Model / User.php
index 3355695f24bc985915c8c721568bed961d6824b0..e27a950adb57f609039f93e7ad5b5ff85f16d446 100644 (file)
@@ -844,12 +844,16 @@ class User
         * Get avatar link for given user
         *
         * @param array  $user
-        * @param string $size One of the ProxyUtils::SIZE_* constants
+        * @param string $size One of the Proxy::SIZE_* constants
         * @return string avatar link
         * @throws Exception
         */
        public static function getAvatarUrl(array $user, string $size = ''):string
        {
+               if (empty($user['nickname'])) {
+                       DI::logger()->warning('Missing user nickname key', ['trace' => System::callstack(20)]);
+               }
+
                $url = DI::baseUrl() . '/photo/';
 
                switch ($size) {
@@ -879,7 +883,7 @@ class User
                        }
                }
 
-               return $url . $user['uid'] . image_type_to_extension($imagetype) . ($updated ? '?ts=' . strtotime($updated) : '');
+               return $url . $user['nickname'] . image_type_to_extension($imagetype) . ($updated ? '?ts=' . strtotime($updated) : '');
        }
 
        /**