diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-03-08 20:17:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 20:17:39 +0800 |
commit | b116418f05b822481bba3613873eef876da73814 (patch) | |
tree | 65d1d88d940c26029e7ef920c4dd30761763ce46 /modules/storage/local.go | |
parent | 090e75392385041b3abb30d02564962a3ff687f6 (diff) | |
download | gitea-b116418f05b822481bba3613873eef876da73814.tar.gz gitea-b116418f05b822481bba3613873eef876da73814.zip |
Use CleanPath instead of path.Clean (#23371)
As title.
Diffstat (limited to 'modules/storage/local.go')
-rw-r--r-- | modules/storage/local.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/storage/local.go b/modules/storage/local.go index a6a9d54a8c..05bf1fb28a 100644 --- a/modules/storage/local.go +++ b/modules/storage/local.go @@ -8,7 +8,6 @@ import ( "io" "net/url" "os" - "path" "path/filepath" "strings" @@ -59,7 +58,7 @@ func NewLocalStorage(ctx context.Context, cfg interface{}) (ObjectStorage, error } func (l *LocalStorage) buildLocalPath(p string) string { - return filepath.Join(l.dir, path.Clean("/" + strings.ReplaceAll(p, "\\", "/"))[1:]) + return filepath.Join(l.dir, util.CleanPath(strings.ReplaceAll(p, "\\", "/"))) } // Open a file |