Преглед изворни кода

Escape paths for find file correctly (#30026)

Fix #30020
tags/v1.22.0-rc0
wxiaoguang пре 2 месеци
родитељ
комит
1cdc6c3a4e
No account linked to committer's email address
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3
    2
      routers/web/repo/find.go

+ 3
- 2
routers/web/repo/find.go Прегледај датотеку

@@ -7,6 +7,7 @@ import (
"net/http"

"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/context"
)

@@ -17,7 +18,7 @@ const (
// FindFiles render the page to find repository files
func FindFiles(ctx *context.Context) {
path := ctx.Params("*")
ctx.Data["TreeLink"] = ctx.Repo.RepoLink + "/src/" + path
ctx.Data["DataLink"] = ctx.Repo.RepoLink + "/tree-list/" + path
ctx.Data["TreeLink"] = ctx.Repo.RepoLink + "/src/" + util.PathEscapeSegments(path)
ctx.Data["DataLink"] = ctx.Repo.RepoLink + "/tree-list/" + util.PathEscapeSegments(path)
ctx.HTML(http.StatusOK, tplFindFiles)
}

Loading…
Откажи
Сачувај