瀏覽代碼

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

TC pushbot 5 4 年之前
父節點
當前提交
ee0af4ed57
共有 1 個文件被更改,包括 2 次插入2 次删除
  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)