remove . and .. for FTP

pull/548/head
Xhofe 2021-12-25 19:22:05 +08:00
parent 12af9cb89f
commit 26b4766da7
2 changed files with 4 additions and 0 deletions

1
.gitignore vendored
View File

@ -25,4 +25,5 @@ bin/*
*.json
public/index.html
public/assets/
public/public/
data/

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),