1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-25 04:29:40 +02:00

Fix path cleanup in multiple places (#3871)

This commit is contained in:
Lauris BH 2018-05-01 04:46:04 +03:00 committed by Bo-Yi Wu
parent fff022ef8a
commit 181b3a8f09
3 changed files with 17 additions and 7 deletions

View file

@ -1133,7 +1133,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.