mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40: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
|
||||
}
|
||||
|
||||
if !util.IsValidUploadFileName(filepath.Base(fileAbsPath)) { // Improve kernel API `/api/file/putFile` parameter validation https://github.com/siyuan-note/siyuan/issues/14658
|
||||
ret.Code = http.StatusBadRequest
|
||||
ret.Msg = "invalid file path, please check https://github.com/siyuan-note/siyuan/issues/14658 for more details"
|
||||
return
|
||||
fileExists := filelock.IsExist(fileAbsPath)
|
||||
if !fileExists {
|
||||
if !util.IsValidUploadFileName(filepath.Base(fileAbsPath)) { // Improve kernel API `/api/file/putFile` parameter validation https://github.com/siyuan-note/siyuan/issues/14658
|
||||
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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue