forked from forgejo/forgejo
Send size to /avatars if requested (#15459)
If an avatar is requested in a particular size ensure that /avatars also gets the size request Fix #15453 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
c29620c05f
commit
324cff68c9
2 changed files with 11 additions and 3 deletions
|
@ -82,6 +82,9 @@ func (u *User) RealSizedAvatarLink(size int) string {
|
|||
if u.Avatar == "" {
|
||||
return DefaultAvatarLink()
|
||||
}
|
||||
if size > 0 {
|
||||
return setting.AppSubURL + "/avatars/" + u.Avatar + "?size=" + strconv.Itoa(size)
|
||||
}
|
||||
return setting.AppSubURL + "/avatars/" + u.Avatar
|
||||
case setting.DisableGravatar, setting.OfflineMode:
|
||||
if u.Avatar == "" {
|
||||
|
@ -89,7 +92,9 @@ func (u *User) RealSizedAvatarLink(size int) string {
|
|||
log.Error("GenerateRandomAvatar: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if size > 0 {
|
||||
return setting.AppSubURL + "/avatars/" + u.Avatar + "?size=" + strconv.Itoa(size)
|
||||
}
|
||||
return setting.AppSubURL + "/avatars/" + u.Avatar
|
||||
}
|
||||
return SizedAvatarLink(u.AvatarEmail, size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue