1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Notify the user when the file path contains leading or trailing spaces and fix the error message for invalid file names. (#31507)

close #31478
This commit is contained in:
charles
2024-09-25 03:06:52 +08:00
committed by GitHub
parent 6fa962f409
commit 3269b04d61
2 changed files with 45 additions and 6 deletions

View File

@ -317,7 +317,7 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b
case git.EntryModeBlob:
ctx.RenderWithErr(ctx.Tr("repo.editor.directory_is_a_file", fileErr.Path), tplEditFile, &form)
default:
ctx.Error(http.StatusInternalServerError, err.Error())
ctx.RenderWithErr(ctx.Tr("repo.editor.filename_is_invalid", fileErr.Path), tplEditFile, &form)
}
} else {
ctx.Error(http.StatusInternalServerError, err.Error())