Skip to content

Commit

Permalink
fix validating attachment names
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Sep 26, 2023
1 parent 9c6b0ee commit d9e0355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d9e0355

Please sign in to comment.