From 43cc09af8d745c65f8f8ff60a5c94ae121e58a6d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 5 Jan 2023 19:39:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=9A=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=20Fix=20?= =?UTF-8?q?https://github.com/siyuan-note/siyuan/issues/4642?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/api/workspace.go | 4 ++++ 1 file changed, 4 insertions(+) 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 }