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:
@ -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())
|
||||
|
Reference in New Issue
Block a user