Edit: Fix path sanitization.

Spaces are being replaced with underscores
This commit is contained in:
2022-09-15 22:23:30 +02:00
parent 820ed99021
commit a55ce1b5ff

View File

@@ -102,7 +102,7 @@ module.exports = {
await m.reply({ content: "An invalid image has been attached", ephemeral: true }); await m.reply({ content: "An invalid image has been attached", ephemeral: true });
return; return;
} }
let identifier = `${record.Band.name}/${image.name}`; let identifier = `${record.Band.name.replace(" ", "_")}/${image.name}`;
let path = `/app/assets/cards/${identifier}`; let path = `/app/assets/cards/${identifier}`;
await this.downloadImage(image.attachment, path); await this.downloadImage(image.attachment, path);
await this.updateRecord(user, record, option, identifier); await this.updateRecord(user, record, option, identifier);