diff --git a/kernel/api/workspace.go b/kernel/api/workspace.go index 6d281866d..d29a7c64a 100644 --- a/kernel/api/workspace.go +++ b/kernel/api/workspace.go @@ -24,6 +24,7 @@ import ( "path/filepath" "strings" "time" + "unicode/utf8" "github.com/88250/gulu" "github.com/gin-gonic/gin" @@ -233,5 +234,8 @@ func isInvalidWorkspacePath(absPath string) bool { if !gulu.File.IsValidFilename(name) { return true } + if 16 < utf8.RuneCountInString(name) { + return true + } return "siyuan" == name || "conf" == name || "home" == name || "data" == name || "temp" == name }