0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 15:53:07 -05:00

Fix #3314: Cannot edit release with tag name contains slash (#3434)

This commit is contained in:
Thibault Meyer 2016-08-11 22:45:42 +02:00 committed by 无闻
parent 10b47eddd2
commit 53c573ed02
2 changed files with 4 additions and 4 deletions

View file

@ -488,8 +488,8 @@ func runWeb(ctx *cli.Context) error {
m.Group("/releases", func() { m.Group("/releases", func() {
m.Get("/new", repo.NewRelease) m.Get("/new", repo.NewRelease)
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
m.Get("/edit/:tagname", repo.EditRelease) m.Get("/edit/*", repo.EditRelease)
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
m.Post("/delete", repo.DeleteRelease) m.Post("/delete", repo.DeleteRelease)
}, reqRepoWriter, context.RepoRef()) }, reqRepoWriter, context.RepoRef())

View file

@ -224,7 +224,7 @@ func EditRelease(ctx *context.Context) {
ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsReleaseList"] = true
ctx.Data["PageIsEditRelease"] = true ctx.Data["PageIsEditRelease"] = true
tagName := ctx.Params(":tagname") tagName := ctx.Params("*")
rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName) rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName)
if err != nil { if err != nil {
if models.IsErrReleaseNotExist(err) { if models.IsErrReleaseNotExist(err) {
@ -249,7 +249,7 @@ func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) {
ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsReleaseList"] = true
ctx.Data["PageIsEditRelease"] = true ctx.Data["PageIsEditRelease"] = true
tagName := ctx.Params(":tagname") tagName := ctx.Params("*")
rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName) rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName)
if err != nil { if err != nil {
if models.IsErrReleaseNotExist(err) { if models.IsErrReleaseNotExist(err) {