From 31fe8837e42d32981f79226041f3d585b4c5251a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 3 Jun 2022 16:20:55 +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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/model/sync.go b/kernel/model/sync.go index a913371e5..33e51cf2c 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -1112,6 +1112,8 @@ func CreateCloudSyncDir(name string) (err error) { syncLock.Lock() defer syncLock.Unlock() + name = strings.TrimSpace(name) + name = util.RemoveInvisible(name) if !IsValidCloudDirName(name) { return errors.New(Conf.Language(37)) } @@ -1197,7 +1199,10 @@ func formatErrorMsg(err error) string { } func IsValidCloudDirName(cloudDirName string) bool { - if 64 < len(cloudDirName) { + if "backup" == cloudDirName { + return false + } + if 16 < len(cloudDirName) { return false }