From 112bd816ecf0a2a196233b7c23874fa761760e3d Mon Sep 17 00:00:00 2001 From: Armored Dragon Date: Tue, 9 Jul 2024 13:37:20 -0500 Subject: [PATCH 1/2] Sanitize notification text. Signed-off-by: Armored Dragon --- scripts/communityScripts/notificationCore/notificationCore.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/communityScripts/notificationCore/notificationCore.js b/scripts/communityScripts/notificationCore/notificationCore.js index 51e1eadde1..aea94da5d7 100644 --- a/scripts/communityScripts/notificationCore/notificationCore.js +++ b/scripts/communityScripts/notificationCore/notificationCore.js @@ -21,6 +21,8 @@ var DEFAULT_SIZE = 30; var DEFAULT_OFFSET = 10; var FLOOF_NOTIFICATION_CHANNEL = "Floof-Notif"; var MAIN_CHAT_APP_CHANNEL = "Chat"; +var ARROW_REGEX = /\= 0; i--) { if (i === 0) { From e56ea656f6730552fcf58ae532da6edcd013edc1 Mon Sep 17 00:00:00 2001 From: Armored Dragon Date: Wed, 10 Jul 2024 10:24:20 -0500 Subject: [PATCH 2/2] Also check sender name. Signed-off-by: Armored Dragon --- scripts/communityScripts/notificationCore/notificationCore.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/communityScripts/notificationCore/notificationCore.js b/scripts/communityScripts/notificationCore/notificationCore.js index aea94da5d7..f7ab6e73cd 100644 --- a/scripts/communityScripts/notificationCore/notificationCore.js +++ b/scripts/communityScripts/notificationCore/notificationCore.js @@ -64,6 +64,7 @@ var notificationCore = { }, add: function (text, sender, colour) { sender = sender ? sender : "NoName"; + sender = sender.replace(ARROW_REGEX, "<"); colour = colour ? colour : {}; colour.text = colour.text ? colour.text : {red: 255, green: 255, blue: 255}; colour.bg = colour.bg ? colour.bg : {red: 10, green: 10, blue: 10};