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/options/base.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/options/base.go')
-rw-r--r-- | modules/options/base.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/options/base.go b/modules/options/base.go index 3c140f6432..e83e8df5d0 100644 --- a/modules/options/base.go +++ b/modules/options/base.go @@ -16,27 +16,27 @@ import ( // Locale reads the content of a specific locale from static/bindata or custom path. func Locale(name string) ([]byte, error) { - return fileFromDir(path.Join("locale", path.Clean("/"+name))) + return fileFromDir(path.Join("locale", util.CleanPath(name))) } // Readme reads the content of a specific readme from static/bindata or custom path. func Readme(name string) ([]byte, error) { - return fileFromDir(path.Join("readme", path.Clean("/"+name))) + return fileFromDir(path.Join("readme", util.CleanPath(name))) } // Gitignore reads the content of a gitignore locale from static/bindata or custom path. func Gitignore(name string) ([]byte, error) { - return fileFromDir(path.Join("gitignore", path.Clean("/"+name))) + return fileFromDir(path.Join("gitignore", util.CleanPath(name))) } // License reads the content of a specific license from static/bindata or custom path. func License(name string) ([]byte, error) { - return fileFromDir(path.Join("license", path.Clean("/"+name))) + return fileFromDir(path.Join("license", util.CleanPath(name))) } // Labels reads the content of a specific labels from static/bindata or custom path. func Labels(name string) ([]byte, error) { - return fileFromDir(path.Join("label", path.Clean("/"+name))) + return fileFromDir(path.Join("label", util.CleanPath(name))) } // WalkLocales reads the content of a specific locale |