thanks madness for pointing out line break still being a problem
This commit is contained in:
+2
-2
@@ -307,12 +307,12 @@ async function checkNewMessages(channel_selected, admin_chat_bool) {
|
|||||||
function sanitizeForRcon(str, maxLength = 200) {
|
function sanitizeForRcon(str, maxLength = 200) {
|
||||||
if (typeof str !== 'string') return '';
|
if (typeof str !== 'string') return '';
|
||||||
return str
|
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()
|
.trim()
|
||||||
.slice(0, maxLength);
|
.slice(0, maxLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var lastProcessedMessageId_rcon_ze = null;
|
var lastProcessedMessageId_rcon_ze = null;
|
||||||
async function checkNewMessages_rcon_ze() {
|
async function checkNewMessages_rcon_ze() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user