forked from forgejo/forgejo
Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392)
Fix #26389 And complete an old TODO: `ctx.Params does un-escaping,..., which is incorrect.`
This commit is contained in:
parent
906e253d5e
commit
c2e0143bfe
5 changed files with 27 additions and 17 deletions
|
@ -185,7 +185,7 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
|
|||
ctx.Data["Pages"] = pages
|
||||
|
||||
// get requested page name
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
if len(pageName) == 0 {
|
||||
pageName = "Home"
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ func renderRevisionPage(ctx *context.Context) (*git.Repository, *git.TreeEntry)
|
|||
}
|
||||
|
||||
// get requested pagename
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
if len(pageName) == 0 {
|
||||
pageName = "Home"
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ func renderEditPage(ctx *context.Context) {
|
|||
}()
|
||||
|
||||
// get requested pagename
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
pageName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
if len(pageName) == 0 {
|
||||
pageName = "Home"
|
||||
}
|
||||
|
@ -647,7 +647,7 @@ func WikiRaw(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
providedWebPath := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
providedWebPath := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
providedGitPath := wiki_service.WebPathToGitPath(providedWebPath)
|
||||
var entry *git.TreeEntry
|
||||
if commit != nil {
|
||||
|
@ -759,7 +759,7 @@ func EditWikiPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
oldWikiName := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
oldWikiName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
newWikiName := wiki_service.UserTitleToWebPath("", form.Title)
|
||||
|
||||
if len(form.Message) == 0 {
|
||||
|
@ -778,7 +778,7 @@ func EditWikiPost(ctx *context.Context) {
|
|||
|
||||
// DeleteWikiPagePost delete wiki page
|
||||
func DeleteWikiPagePost(ctx *context.Context) {
|
||||
wikiName := wiki_service.WebPathFromRequest(ctx.Params("*"))
|
||||
wikiName := wiki_service.WebPathFromRequest(ctx.PathParamRaw("*"))
|
||||
if len(wikiName) == 0 {
|
||||
wikiName = "Home"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue