Ver Fonte

Added anti noobs design for -root paths in file manager list root function

TC pushbot 5 há 4 anos atrás
pai
commit
ee0af4ed57
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      file_system.go

+ 2 - 2
file_system.go

@@ -1766,8 +1766,8 @@ func system_fs_listRoot(w http.ResponseWriter, r *http.Request) {
 			IsDir    bool
 		}
 		//List the root media folders under user:/
-		var filesInUserRoot []fileObject
-		filesInRoot, _ := filepath.Glob(*root_directory + "users/" + username + "/*")
+		filesInUserRoot := []fileObject{}
+		filesInRoot, _ := filepath.Glob(filepath.ToSlash(filepath.Clean(*root_directory)) + "/users/" + username + "/*")
 		for _, file := range filesInRoot {
 			thisFile := new(fileObject)
 			thisFile.Filename = filepath.Base(file)