From fb1dd6b53aee68722b057f9a460eb618c61dd1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AA=A8=EB=A9=94MoMe?= Date: Wed, 29 Jul 2020 19:47:20 +0900 Subject: [PATCH] fix(Util): Fix cleanContent mention exploit (#4663) --- src/util/Util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/Util.js b/src/util/Util.js index c4fcf4826..8f8eb3740 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -560,15 +560,15 @@ class Util { const id = input.replace(/<|!|>|@/g, ''); if (message.channel.type === 'dm') { const user = message.client.users.cache.get(id); - return user ? `@${user.username}` : input; + return user ? Util.removeMentions(`@${user.username}`) : input; } const member = message.channel.guild.members.cache.get(id); if (member) { - return `@${member.displayName}`; + return Util.removeMentions(`@${member.displayName}`); } else { const user = message.client.users.cache.get(id); - return user ? `@${user.username}` : input; + return user ? Util.removeMentions(`@${user.username}`) : input; } }) .replace(/<#[0-9]+>/g, input => {