Skip to content

Commit

Permalink
🎨 Improve workspace path checking #7569
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 15, 2025
1 parent c70bf35 commit 15231be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/api/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 15231be

Please sign in to comment.