From e040b38a57dfc654941528d19249c538d133681f Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 8 Aug 2026 13:49:52 +0200 Subject: [PATCH] thanks madness for pointing out line break still being a problem --- mapinfo_stoat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapinfo_stoat.js b/mapinfo_stoat.js index ac59605..a67270f 100644 --- a/mapinfo_stoat.js +++ b/mapinfo_stoat.js @@ -307,12 +307,12 @@ async function checkNewMessages(channel_selected, admin_chat_bool) { function sanitizeForRcon(str, maxLength = 200) { if (typeof str !== 'string') return ''; return str - .replace(/[^\w\s.,!?'\-]/g, '') // keep only safe chars, strip everything else + .replace(/[\r\n]+/g, ' ') // collapse newlines to a space first + .replace(/[^\w .,!?'\-]/g, '') // note: \s replaced with a literal space .trim() .slice(0, maxLength); } - var lastProcessedMessageId_rcon_ze = null; async function checkNewMessages_rcon_ze() { try {