From d9c1a01c9ba30b16f0268abd11e463a707669340 Mon Sep 17 00:00:00 2001 From: nubenum Date: Mon, 9 Apr 2018 21:10:40 +0200 Subject: [PATCH] switch to stdlib url escaping Signed-off-by: Robin Durner --- modules/context/repo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/context/repo.go b/modules/context/repo.go index 53dbaa3bc..d39c84ec4 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -8,6 +8,7 @@ package context import ( "fmt" "io/ioutil" + "net/url" "path" "strings" @@ -620,7 +621,7 @@ func RepoRefByType(refType RepoRefType) macaron.Handler { ctx.Redirect(path.Join( setting.AppSubURL, path.Dir(ctx.Req.URL.String()), - strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(ctx.Repo.BranchNameSubURL()), + (&url.URL{Path: ctx.Repo.BranchNameSubURL()}).String(), ctx.Repo.TreePath)) return }