Fix suggested names for saved attachments

This commit is contained in:
Fedor Indutny
2025-09-22 14:49:05 -07:00
committed by GitHub
parent af1125d4e4
commit b2d54e1227

View File

@@ -267,7 +267,11 @@ export const saveAttachmentToDisk = async ({
}
filePath = dialogFilePath;
} else {
filePath = join(baseDir, name);
filePath = join(baseDir, basename(name));
if (!isPathInside(filePath, baseDir)) {
throw new Error('Invalid attachment path');
}
}
await writeWithAttributes(filePath, data);