Commit d685bbf
fix(api/remove): add validation for empty items in delete file list (OpenListTeam#1617)
* fix(FsRemove): add validation for empty items in delete file list
If Req.Names contains an empty string item, the whole directory will be removed. As a result we need add a simple guard to prevent such cases.
Signed-off-by: huyuantao <huyuantao@ultrarisc.com>
* fix(FsRemove): enhance validation to prevent unintended directory deletion
1. Use `utils.FixAndCleanPath` to correctly identify and block invalid names.
2. Change error handling from `return` to `continue`.
Signed-off-by: huyuantao <huyuantao@ultrarisc.com>
---------
Signed-off-by: huyuantao <huyuantao@ultrarisc.com>
Co-authored-by: Pikachu Ren <40362270+PIKACHUIM@users.noreply.github.com>1 parent 27732cc commit d685bbf
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
| |||
0 commit comments