summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-05-01 04:46:04 +0300
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-05-01 09:46:04 +0800
commit181b3a8f0988ab729270279e6e12534cb52628cc (patch)
tree33ddb166d5284c1d82b765c28634f6ba42bf3b13 /models
parentfff022ef8a924705e3fd0250aea740292ffd6552 (diff)
downloadgitea-181b3a8f0988ab729270279e6e12534cb52628cc.tar.gz
gitea-181b3a8f0988ab729270279e6e12534cb52628cc.zip
Fix path cleanup in multiple places (#3871)
Diffstat (limited to 'models')
-rw-r--r--models/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index a7e8bd2a52..99ab247566 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -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.