diff --git a/lib/security.js b/lib/security.js index fba5a5c81..4fa8b6e4c 100644 --- a/lib/security.js +++ b/lib/security.js @@ -342,8 +342,8 @@ function messageFilter (message, client, isEdit) { function isAttachmentOk (a) { const isImage = a.width > 0 && a.height > 0 - const url = a.url.toLowerCase() - const ext = path.extname(url) + const name = a.name + const ext = path.extname(name) return isImage || config.spam.allowedExtensions.includes(ext) }