From 2aff63e4a1e48fb49bdf1a401b1c052bf99aba25 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sat, 28 Apr 2018 03:10:57 +0200 Subject: [PATCH] Strip all non a-z 0-9 characters from !shout commands --- sharedPlugins/globalChat/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sharedPlugins/globalChat/index.js b/sharedPlugins/globalChat/index.js index d121efaf..0e4422d4 100644 --- a/sharedPlugins/globalChat/index.js +++ b/sharedPlugins/globalChat/index.js @@ -13,9 +13,7 @@ module.exports = class remoteCommands { message.shift(); message.shift(); let chatMessage = "["+data.instanceID+"]"+ message.join(" "); - while(chatMessage.includes("'")){ - chatMessage = chatMessage.replace("'", ""); - } + chatMessage = chatMessage.replace(/[^a-zA-Z0-9]+/g, ""); this.messageInterface("/silent-command game.print('"+chatMessage.replace("!shout ","")+"')"); } }