diff options
author | Martin van Beurden <chadoe@gmail.com> | 2014-09-28 14:27:13 +0200 |
---|---|---|
committer | Martin van Beurden <chadoe@gmail.com> | 2014-09-28 14:27:13 +0200 |
commit | bb05ef907b0f19b57d03b035174dbd5fc97af406 (patch) | |
tree | 83816d71417c6fd70d92a6459e8c3b0fb4f3c64b | |
parent | 5e747bc877957c04425fd6d4753794a54798b622 (diff) | |
download | gitea-bb05ef907b0f19b57d03b035174dbd5fc97af406.tar.gz gitea-bb05ef907b0f19b57d03b035174dbd5fc97af406.zip |
Fix AvatarLink when using a suburl and gravatar is disabled or avatars are cached
-rw-r--r-- | models/user.go | 4 | ||||
-rw-r--r-- | modules/base/tool.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/models/user.go b/models/user.go index 8aa349c8a8..3e2ea82f43 100644 --- a/models/user.go +++ b/models/user.go @@ -97,9 +97,9 @@ func (u *User) HomeLink() string { // AvatarLink returns user gravatar link. func (u *User) AvatarLink() string { if setting.DisableGravatar { - return "/img/avatar_default.jpg" + return setting.AppSubUrl + "/img/avatar_default.jpg" } else if setting.Service.EnableCacheAvatar { - return "/avatar/" + u.Avatar + return setting.AppSubUrl + "/avatar/" + u.Avatar } return "//1.gravatar.com/avatar/" + u.Avatar } diff --git a/modules/base/tool.go b/modules/base/tool.go index eb0ac9e5bf..b4083d090f 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -146,9 +146,9 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string // AvatarLink returns avatar link by given e-mail. func AvatarLink(email string) string { if setting.DisableGravatar { - return "/img/avatar_default.jpg" + return setting.AppSubUrl + "/img/avatar_default.jpg" } else if setting.Service.EnableCacheAvatar { - return "/avatar/" + EncodeMd5(email) + return setting.AppSubUrl + "/avatar/" + EncodeMd5(email) } return "//1.gravatar.com/avatar/" + EncodeMd5(email) } |