From 747326f27704153e910d3245ca18a2033b3a5d4b Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:33:47 -0500 Subject: [PATCH] Fix a few more missed &s --- server/chat-plugins/responder.ts | 4 ++-- server/chat-plugins/smogtours.ts | 2 +- server/chat-plugins/thing-of-the-day.ts | 2 +- server/chat.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/chat-plugins/responder.ts b/server/chat-plugins/responder.ts index 1996c66b86d4..d23d6bcfa15c 100644 --- a/server/chat-plugins/responder.ts +++ b/server/chat-plugins/responder.ts @@ -164,11 +164,11 @@ export class AutoResponder { } if (str.length > 300 && !raw) throw new Chat.ErrorMessage("Your given string is too long."); return args.map(item => { - const split = item.split('~').map(string => { + const split = item.split('&').map(string => { // allow raw regex for admins and users with @ in Dev if (raw) return string; // escape - return string.replace(/[\\^$.*+?()[\]{}]/g, '\\$~').trim(); + return string.replace(/[\\^$.*+?()[\]{}]/g, '\\$&').trim(); }); return split.map(term => { if (term.length > 100 && !raw) { diff --git a/server/chat-plugins/smogtours.ts b/server/chat-plugins/smogtours.ts index 6d81bc291493..1ce325984298 100644 --- a/server/chat-plugins/smogtours.ts +++ b/server/chat-plugins/smogtours.ts @@ -387,7 +387,7 @@ export const pages: Chat.PageTable = { .replace(/"/g, '"') .replace(/>/g, '>') .replace(/</g, '<') - .replace(/&/g, '~'); + .replace(/&/g, '&'); // stuff! let buf = `${back(categoryID)}${refresh(this.pageid)}
`; buf += `

${tour.title}

`; diff --git a/server/chat-plugins/thing-of-the-day.ts b/server/chat-plugins/thing-of-the-day.ts index d4fd0ca49c8b..28495bc9541f 100644 --- a/server/chat-plugins/thing-of-the-day.ts +++ b/server/chat-plugins/thing-of-the-day.ts @@ -52,7 +52,7 @@ function savePrenoms() { } function toNominationId(nomination: string) { - return nomination.toLowerCase().replace(/\s/g, '').replace(/\b~\b/g, ''); + return nomination.toLowerCase().replace(/\s/g, '').replace(/\b&\b/g, ''); } class OtdHandler { diff --git a/server/chat.ts b/server/chat.ts index 297c17d3ab08..8ea704c06fe2 100644 --- a/server/chat.ts +++ b/server/chat.ts @@ -1604,7 +1604,7 @@ export const Chat = new class { // \uF900-\uFAFF\uFE00-\uFE6F CJK extended name = name.replace( // eslint-disable-next-line no-misleading-character-class - /[^a-zA-Z0-9 /\\.~()<>^*%~=+$#_'?!"\u00A1-\u00BF\u00D7\u00F7\u02B9-\u0362\u2012-\u2027\u2030-\u205E\u2050-\u205F\u2190-\u23FA\u2500-\u2BD1\u2E80-\u32FF\u3400-\u9FFF\uF900-\uFAFF\uFE00-\uFE6F-]+/g, + /[^a-zA-Z0-9 /\\.~()<>^*%&=+$#_'?!"\u00A1-\u00BF\u00D7\u00F7\u02B9-\u0362\u2012-\u2027\u2030-\u205E\u2050-\u205F\u2190-\u23FA\u2500-\u2BD1\u2E80-\u32FF\u3400-\u9FFF\uF900-\uFAFF\uFE00-\uFE6F-]+/g, '' );