]> source.dussan.org Git - gitea.git/commitdiff
#3577 incorrect URL produced by AvatarLink
authorUnknwon <u@gogs.io>
Thu, 1 Sep 2016 16:36:26 +0000 (12:36 -0400)
committerUnknwon <u@gogs.io>
Thu, 1 Sep 2016 16:36:26 +0000 (12:36 -0400)
models/user.go
templates/repo/editor/commit_form.tmpl

index ef769de655ac4dac4df09580b60de46d455ca5c6..946c6c94d4764868347f73df80267157d2dbc53f 100644 (file)
@@ -271,7 +271,7 @@ func (u *User) RelAvatarLink() string {
 func (u *User) AvatarLink() string {
        link := u.RelAvatarLink()
        if link[0] == '/' && link[1] != '/' {
-               return setting.AppUrl + link[1:]
+               return setting.AppUrl + strings.TrimPrefix(link, setting.AppSubUrl)[1:]
        }
        return link
 }
index d76f3fb1c2e1faff4386d7fe4f558ed8189953f9..96b0dcbd3dcd86dfeb6bf4c2f32adc2ff9235afd 100644 (file)
@@ -1,5 +1,5 @@
 <div class="commit-form-wrapper">
-       <img width="48" height="48" class="ui image commit-avatar" src="{{.SignedUser.AvatarLink}}">
+       <img width="48" height="48" class="ui image commit-avatar" src="{{.SignedUser.RelAvatarLink}}">
        <div class="commit-form">
                <h3>{{.i18n.Tr "repo.editor.commit_changes"}}</h3>
                <div class="field">