mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 03:48:48 +01:00
🔒 Some security vulnerabilities https://github.com/siyuan-note/siyuan/issues/13426
This commit is contained in:
parent
2b5a9f9f1a
commit
e70ed57f6e
5 changed files with 28 additions and 1 deletions
|
|
@ -532,7 +532,13 @@ func ExportResources(resourcePaths []string, mainName string) (exportFilePath st
|
|||
|
||||
// 将需要导出的文件/文件夹复制到临时文件夹
|
||||
for _, resourcePath := range resourcePaths {
|
||||
resourceFullPath := filepath.Join(util.WorkspaceDir, resourcePath) // 资源完整路径
|
||||
resourceFullPath := filepath.Join(util.WorkspaceDir, resourcePath) // 资源完整路径
|
||||
if !util.IsAbsPathInWorkspace(resourceFullPath) {
|
||||
logging.LogErrorf("resource path [%s] is not in workspace", resourceFullPath)
|
||||
err = errors.New("resource path [" + resourcePath + "] is not in workspace")
|
||||
return
|
||||
}
|
||||
|
||||
resourceBaseName := filepath.Base(resourceFullPath) // 资源名称
|
||||
resourceCopyPath := filepath.Join(exportFolderPath, resourceBaseName) // 资源副本完整路径
|
||||
if err = filelock.Copy(resourceFullPath, resourceCopyPath); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue