From 64a08ccd3740f5c15479fb90afcfec54e6f22038 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 24 Sep 2022 06:14:45 -0500 Subject: [PATCH] Use encode URI component for webhook --- scripts/server/discord.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/server/discord.js b/scripts/server/discord.js index ea801bd0..9cf67cc5 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -184,7 +184,7 @@ function triggerDiscordWebHook(messageString, serverId = getServerId(), type = A } let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL; - tempURL = tempURL.replace("{0}", encodeURI(messageString)); + tempURL = tempURL.replace("{0}", encodeURIComponent(messageString)); tempURL = tempURL.replace("{1}", serverId); tempURL = tempURL.replace("{2}", type); tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass); @@ -211,7 +211,7 @@ function triggerClanDiscordWebHook(clanIndex, messageString) { let webhookURL = getClanData(clanIndex).discordWebhookURL; let tempURL = getGlobalConfig().discord.webhook.webhookBaseURL; - tempURL = tempURL.replace("{0}", encodeURI(messageString)); + tempURL = tempURL.replace("{0}", encodeURIComponent(messageString)); tempURL = tempURL.replace("{1}", serverId); tempURL = tempURL.replace("{2}", type); tempURL = tempURL.replace("{3}", getGlobalConfig().discord.webhook.pass);