Browse Source

Fixed File Explorer showing metadata on user root bug

Toby Chui 3 năm trước cách đây
mục cha
commit
4d8d6c7728
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      file_system.go

+ 4 - 0
file_system.go

@@ -2003,6 +2003,10 @@ func system_fs_listRoot(w http.ResponseWriter, r *http.Request) {
 		filesInUserRoot := []fileObject{}
 		filesInRoot, _ := filepath.Glob(filepath.ToSlash(filepath.Clean(*root_directory)) + "/users/" + username + "/*")
 		for _, file := range filesInRoot {
+			//Check if this is a hidden file
+			if len(filepath.Base(file)) > 0 && filepath.Base(file)[:1] == "." {
+				continue
+			}
 			thisFile := new(fileObject)
 			thisFile.Filename = filepath.Base(file)
 			thisFile.Filepath, _ = userinfo.RealPathToVirtualPath(file)