Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 文件名包含 `.` 时的重命名问题 Fix https://github.com/siyuan-note/siyuan/issues/7686

Liang Ding50e79b94765f
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 57632afde2..23eed4f10d 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -492,7 +492,7 @@ func RenameAsset(oldPath, newName string) (err error) {
return
}
- newName = util.AssetName(newName) + filepath.Ext(oldPath)
+ newName = util.AssetName(newName + filepath.Ext(oldPath))
newPath := "assets/" + newName
if err = filelock.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
logging.LogErrorf("copy asset [%s] failed: %s", oldPath, err)