mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve workspace path checking https://github.com/siyuan-note/siyuan/issues/7569
This commit is contained in:
parent
c70bf3571f
commit
15231be474
1 changed files with 1 additions and 1 deletions
|
|
@ -289,7 +289,7 @@ func setWorkspaceDir(c *gin.Context) {
|
|||
// 改进判断工作空间路径实现 https://github.com/siyuan-note/siyuan/issues/7569
|
||||
installDirLower := strings.ToLower(filepath.Dir(util.WorkingDir))
|
||||
pathLower := strings.ToLower(path)
|
||||
if strings.HasPrefix(pathLower, installDirLower) && util.IsSubPath(installDirLower, pathLower) {
|
||||
if strings.HasPrefix(pathLower, installDirLower) && (util.IsSubPath(installDirLower, pathLower) || filepath.Clean(installDirLower) == filepath.Clean(pathLower)) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(98)
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 5000}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue