🐛 File system exception when exporting docs containing ../ hyperlinks to Markdown Fix https://github.com/siyuan-note/siyuan/issues/9779

This commit is contained in:
Daniel 2023-11-30 12:37:33 +08:00
parent ee351057f1
commit c9f90c606e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 22 additions and 6 deletions

View file

@ -268,9 +268,12 @@ func IsDisplayableAsset(p string) bool {
func GetAbsPathInWorkspace(relPath string) (string, error) {
absPath := filepath.Join(WorkspaceDir, relPath)
if WorkspaceDir == absPath {
return absPath, nil
}
if IsSubPath(WorkspaceDir, absPath) {
return absPath, nil
} else {
return "", os.ErrPermission
}
return "", os.ErrPermission
}