summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-01-19 21:03:15 +0000
committerGitHub <noreply@github.com>2022-01-19 21:03:15 +0000
commit6b0a71230d0ff5f9822bf889e88424f46f1ffff9 (patch)
tree84b87f2a10763f6b3c6af43d662e4d470a2ca694 /routers
parentc68f1281f62524858ec0b88d8f01aef5b125b2d0 (diff)
downloadgitea-6b0a71230d0ff5f9822bf889e88424f46f1ffff9.tar.gz
gitea-6b0a71230d0ff5f9822bf889e88424f46f1ffff9.zip
Stop trimming preceding and suffixing spaces from editor filenames (#18334)v1.16.0-rc1
* Stop trimming preceding and suffixing spaces from editor filenames In #5702 it was decided to trim preceding and suffixed spaces aswell as / from editing file filenames. This was because at this point in time the url-safety of Gitea was much poorer. We can now drop this requirement and file editing should work correctly. Fix #18176 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/editor.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go
index 1a7edb7bb4..5904ba2f0b 100644
--- a/routers/web/repo/editor.go
+++ b/routers/web/repo/editor.go
@@ -728,7 +728,7 @@ func UploadFilePost(ctx *context.Context) {
func cleanUploadFileName(name string) string {
// Rebase the filename
- name = strings.Trim(path.Clean("/"+name), " /")
+ name = strings.Trim(path.Clean("/"+name), "/")
// Git disallows any filenames to have a .git directory in them.
for _, part := range strings.Split(name, "/") {
if strings.ToLower(part) == ".git" {