diff --git a/src/ui/chat/chat.ts b/src/ui/chat/chat.ts index 487c548f..ae74683c 100644 --- a/src/ui/chat/chat.ts +++ b/src/ui/chat/chat.ts @@ -240,7 +240,17 @@ export class Chat extends Base { } private sanitize(input: string): string { - const sanitized = input.replace(//g, '>').trim(); + const map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '/': '/', + }; + const sanitized = input + .replace(/[&<>"'/]/g, (char) => map[char as keyof typeof map]) + .trim(); return sanitized; }