mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-09 19:31:21 +01:00
Merge pull request #509 from chadoe/avatarlink
Fix AvatarLink when using a suburl
This commit is contained in:
commit
38f71af363
2 changed files with 4 additions and 4 deletions
|
@ -97,9 +97,9 @@ func (u *User) HomeLink() string {
|
||||||
// AvatarLink returns user gravatar link.
|
// AvatarLink returns user gravatar link.
|
||||||
func (u *User) AvatarLink() string {
|
func (u *User) AvatarLink() string {
|
||||||
if setting.DisableGravatar {
|
if setting.DisableGravatar {
|
||||||
return "/img/avatar_default.jpg"
|
return setting.AppSubUrl + "/img/avatar_default.jpg"
|
||||||
} else if setting.Service.EnableCacheAvatar {
|
} else if setting.Service.EnableCacheAvatar {
|
||||||
return "/avatar/" + u.Avatar
|
return setting.AppSubUrl + "/avatar/" + u.Avatar
|
||||||
}
|
}
|
||||||
return "//1.gravatar.com/avatar/" + u.Avatar
|
return "//1.gravatar.com/avatar/" + u.Avatar
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,9 +146,9 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string
|
||||||
// AvatarLink returns avatar link by given e-mail.
|
// AvatarLink returns avatar link by given e-mail.
|
||||||
func AvatarLink(email string) string {
|
func AvatarLink(email string) string {
|
||||||
if setting.DisableGravatar {
|
if setting.DisableGravatar {
|
||||||
return "/img/avatar_default.jpg"
|
return setting.AppSubUrl + "/img/avatar_default.jpg"
|
||||||
} else if setting.Service.EnableCacheAvatar {
|
} else if setting.Service.EnableCacheAvatar {
|
||||||
return "/avatar/" + EncodeMd5(email)
|
return setting.AppSubUrl + "/avatar/" + EncodeMd5(email)
|
||||||
}
|
}
|
||||||
return "//1.gravatar.com/avatar/" + EncodeMd5(email)
|
return "//1.gravatar.com/avatar/" + EncodeMd5(email)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue