✨ remove . and .. for FTP
This commit is contained in:
parent
12af9cb89f
commit
26b4766da7
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,4 +25,5 @@ bin/*
|
|||||||
*.json
|
*.json
|
||||||
public/index.html
|
public/index.html
|
||||||
public/assets/
|
public/assets/
|
||||||
|
public/public/
|
||||||
data/
|
data/
|
@ -127,6 +127,9 @@ func (driver FTP) Files(path string, account *model.Account) ([]model.File, erro
|
|||||||
res := make([]model.File, 0)
|
res := make([]model.File, 0)
|
||||||
for i, _ := range entries {
|
for i, _ := range entries {
|
||||||
entry := entries[i]
|
entry := entries[i]
|
||||||
|
if entry.Name == "." || entry.Name == ".." {
|
||||||
|
continue
|
||||||
|
}
|
||||||
f := model.File{
|
f := model.File{
|
||||||
Name: entry.Name,
|
Name: entry.Name,
|
||||||
Size: int64(entry.Size),
|
Size: int64(entry.Size),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user