diff --git a/gogs.go b/gogs.go index 73fecd558..497d0f6e1 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.152.0216" +const APP_VER = "0.9.153.0217" func init() { setting.AppVer = APP_VER diff --git a/routers/repo/http.go b/routers/repo/http.go index f2f1110bd..c3cec9e3b 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -95,7 +95,7 @@ func HTTPContexter() macaron.Handler { authUser, err := models.UserSignIn(authUsername, authPassword) if err != nil && !models.IsErrUserNotExist(err) { - ctx.Handle(http.StatusInternalServerError, "UserSignIn: %v", err) + ctx.Handle(http.StatusInternalServerError, "UserSignIn", err) return } @@ -103,7 +103,11 @@ func HTTPContexter() macaron.Handler { if authUser == nil { token, err := models.GetAccessTokenBySHA(authUsername) if err != nil { - ctx.NotFoundOrServerError("GetAccessTokenBySHA", models.IsErrAccessTokenNotExist, err) + if models.IsErrAccessTokenEmpty(err) || models.IsErrAccessTokenNotExist(err) { + ctx.Error(http.StatusUnauthorized) + } else { + ctx.Handle(http.StatusInternalServerError, "GetAccessTokenBySHA", err) + } return } token.Updated = time.Now() diff --git a/templates/.VERSION b/templates/.VERSION index 71394c9fc..7a4cb9cf2 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.152.0216 \ No newline at end of file +0.9.153.0217 \ No newline at end of file diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index d00c9aea2..57dd8f4cd 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -33,7 +33,7 @@ @@ -47,7 +47,7 @@ @@ -105,7 +105,7 @@ {{.Title}} {{range .Labels}} - {{.Name}} + {{.Name | Sanitize}} {{end}} {{if .NumComments}} @@ -116,7 +116,7 @@ {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} {{if .Milestone}} - {{.Milestone.Name}} + {{.Milestone.Name | Sanitize}} {{end}} {{if .Assignee}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 038eaabd8..e90558431 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -26,7 +26,7 @@
{{range .Milestones}}
  • - {{.Name}} + {{.Name | Sanitize}}
    diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index e3ecfe742..3296bc09f 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -272,7 +272,7 @@ {{.i18n.Tr "repo.issues.new.no_label"}} {{range .Labels}} {{end}} @@ -294,7 +294,7 @@ {{.i18n.Tr "repo.issues.new.open_milestone"}}
    {{range .OpenMilestones}} -
    {{.Name}}
    +
    {{.Name | Sanitize}}
    {{end}} {{end}} {{if .ClosedMilestones}} @@ -304,7 +304,7 @@ {{.i18n.Tr "repo.issues.new.closed_milestone"}}
    {{range .ClosedMilestones}} - {{.Name}} + {{.Name | Sanitize}} {{end}} {{end}}
  • @@ -313,7 +313,7 @@ {{.i18n.Tr "repo.issues.new.no_milestone"}}
    {{if .Issue.Milestone}} - {{.Issue.Milestone.Name}} + {{.Issue.Milestone.Name | Sanitize}} {{end}}