mirror of
https://github.com/go-gitea/gitea
synced 2025-07-30 06:08:35 +00:00
@@ -726,7 +726,7 @@ func UploadFilePost(ctx *context.Context) {
|
||||
|
||||
func cleanUploadFileName(name string) string {
|
||||
// Rebase the filename
|
||||
name = strings.Trim(path.Clean("/"+name), "/")
|
||||
name = strings.Trim(util.CleanPath(name), "/")
|
||||
// Git disallows any filenames to have a .git directory in them.
|
||||
for _, part := range strings.Split(name, "/") {
|
||||
if strings.ToLower(part) == ".git" {
|
||||
|
@@ -207,7 +207,7 @@ func LFSLockFile(ctx *context.Context) {
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/lfs/locks")
|
||||
return
|
||||
}
|
||||
lockPath = path.Clean("/" + lockPath)[1:]
|
||||
lockPath = util.CleanPath(lockPath)
|
||||
if len(lockPath) == 0 {
|
||||
ctx.Flash.Error(ctx.Tr("repo.settings.lfs_invalid_locking_path", originalPath))
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/lfs/locks")
|
||||
|
Reference in New Issue
Block a user