* 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) {
}
}
- 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) : '');
}
/**