1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 12:38:20 +00:00

Fix path cleanup in multiple places (#3871) (#3873)

This commit is contained in:
Lauris BH
2018-05-01 12:10:50 +03:00
committed by Bo-Yi Wu
parent 9be48f04cb
commit 15cdb19d77
3 changed files with 17 additions and 7 deletions

View File

@@ -1131,7 +1131,7 @@ type CreateRepoOptions struct {
}
func getRepoInitFile(tp, name string) ([]byte, error) {
cleanedName := strings.TrimLeft(name, "./")
cleanedName := strings.TrimLeft(path.Clean("/"+name), "/")
relPath := path.Join("options", tp, cleanedName)
// Use custom file when available.