mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 08:55:20 +02:00
* Check if file is a symlink with web editor (#3687) * editor checks for symlinks * translate file_is_a_symlink message * credit translation author * fix error constant
This commit is contained in:
parent
e0ecd9fd93
commit
0e1392501d
6 changed files with 10 additions and 0 deletions
|
@ -186,6 +186,11 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo
|
|||
return
|
||||
}
|
||||
} else {
|
||||
if entry.IsLink() {
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.file_is_a_symlink", part), tplEditFile, &form)
|
||||
return
|
||||
}
|
||||
if entry.IsDir() {
|
||||
ctx.Data["Err_TreePath"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("repo.editor.filename_is_a_directory", part), tplEditFile, &form)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue