remove . and .. for FTP

This commit is contained in:
Xhofe
2021-12-25 19:22:05 +08:00
parent 12af9cb89f
commit 26b4766da7
2 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,9 @@ func (driver FTP) Files(path string, account *model.Account) ([]model.File, erro
res := make([]model.File, 0)
for i, _ := range entries {
entry := entries[i]
if entry.Name == "." || entry.Name == ".." {
continue
}
f := model.File{
Name: entry.Name,
Size: int64(entry.Size),