From b9eaba06899c879eb5330ce8c801c28c88838139 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 3 Jun 2022 16:22:39 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E4=BA=91=E7=AB=AF?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=9B=AE=E5=BD=95=E5=90=8D=E7=A7=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=20Fix=20https://github.com/siyuan-note/siyuan/issues/?= =?UTF-8?q?5090?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/sync.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/model/sync.go b/kernel/model/sync.go index 33e51cf2c..15339f2b0 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -30,6 +30,7 @@ import ( "strings" "sync" "time" + "unicode/utf8" "github.com/88250/gulu" "github.com/dustin/go-humanize" @@ -1202,7 +1203,8 @@ func IsValidCloudDirName(cloudDirName string) bool { if "backup" == cloudDirName { return false } - if 16 < len(cloudDirName) { + + if 16 < utf8.RuneCountInString(cloudDirName) { return false } @@ -1216,9 +1218,7 @@ func IsValidCloudDirName(cloudDirName string) bool { if strings.ContainsAny(cloudDirName, charsStr) { return false } - - tmp := util.RemoveInvisible(cloudDirName) - return tmp == cloudDirName + return true } func getSyncIgnoreList() (ret *hashset.Set) {