mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Do not validate file names when updating existing files https://github.com/siyuan-note/siyuan/issues/16536 (#16539)
This commit is contained in:
parent
be53f83c59
commit
cb58c643fc
1 changed files with 7 additions and 4 deletions
|
|
@ -380,10 +380,13 @@ func putFile(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !util.IsValidUploadFileName(filepath.Base(fileAbsPath)) { // Improve kernel API `/api/file/putFile` parameter validation https://github.com/siyuan-note/siyuan/issues/14658
|
fileExists := filelock.IsExist(fileAbsPath)
|
||||||
ret.Code = http.StatusBadRequest
|
if !fileExists {
|
||||||
ret.Msg = "invalid file path, please check https://github.com/siyuan-note/siyuan/issues/14658 for more details"
|
if !util.IsValidUploadFileName(filepath.Base(fileAbsPath)) { // Improve kernel API `/api/file/putFile` parameter validation https://github.com/siyuan-note/siyuan/issues/14658
|
||||||
return
|
ret.Code = http.StatusBadRequest
|
||||||
|
ret.Msg = "invalid file path, please check https://github.com/siyuan-note/siyuan/issues/14658 for more details"
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isDirStr := c.PostForm("isDir")
|
isDirStr := c.PostForm("isDir")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue