summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-05 12:12:54 -0700
committerUnknwon <u@gogs.io>2016-08-05 12:12:54 -0700
commit50422f1fc226d71fe2f5f701c7ebdd1a5f2d143e (patch)
tree649757ae8cac275b0501e684d1c7bb0a5ee2d7d9 /models/user.go
parentdb3d393576c716dbbea500791c5f800e52c70be5 (diff)
downloadgitea-50422f1fc226d71fe2f5f701c7ebdd1a5f2d143e.tar.gz
gitea-50422f1fc226d71fe2f5f701c7ebdd1a5f2d143e.zip
#3348 always use relative avatar link in the template
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go
index 5e9b60addb..ac3d2e819b 100644
--- a/models/user.go
+++ b/models/user.go
@@ -254,11 +254,11 @@ func (u *User) RelAvatarLink() string {
return setting.GravatarSource + u.Avatar
}
-// AvatarLink returns user avatar link.
+// AvatarLink returns user avatar absolute link.
func (u *User) AvatarLink() string {
link := u.RelAvatarLink()
if link[0] == '/' && link[1] != '/' {
- return strings.TrimSuffix(setting.AppUrl, "/") + link
+ return setting.AppUrl + link[1:]
}
return link
}