🎨 改进云端同步目录名称校验 Fix https://github.com/siyuan-note/siyuan/issues/5090
This commit is contained in:
parent
ac9c9cb9e0
commit
31fe8837e4
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue