From a55ce1b5ffc438f798c496555d23a8391d0aa0ea Mon Sep 17 00:00:00 2001 From: Minzkraut Date: Thu, 15 Sep 2022 22:23:30 +0200 Subject: [PATCH] Edit: Fix path sanitization. Spaces are being replaced with underscores --- commands/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/edit.js b/commands/edit.js index fd490b4..069f991 100644 --- a/commands/edit.js +++ b/commands/edit.js @@ -102,7 +102,7 @@ module.exports = { await m.reply({ content: "An invalid image has been attached", ephemeral: true }); return; } - let identifier = `${record.Band.name}/${image.name}`; + let identifier = `${record.Band.name.replace(" ", "_")}/${image.name}`; let path = `/app/assets/cards/${identifier}`; await this.downloadImage(image.attachment, path); await this.updateRecord(user, record, option, identifier);