From 81ed711fac09d1a442a3d2548af20a91c02a899c Mon Sep 17 00:00:00 2001 From: MDMCK10 <21245760+MDMCK10@users.noreply.github.com> Date: Mon, 27 Mar 2023 01:05:18 +0200 Subject: [PATCH] This looks like something that should work --- src/WSServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WSServer.ts b/src/WSServer.ts index 0f1ba56..28ea690 100644 --- a/src/WSServer.ts +++ b/src/WSServer.ts @@ -212,7 +212,7 @@ export default class WSServer { var msg = Utilities.HTMLSanitize(msgArr[1]); // One of the things I hated most about the old server is it completely discarded your message if it was too long if (msg.length > this.Config.collabvm.maxChatLength) msg = msg.substring(0, this.Config.collabvm.maxChatLength); - if (msg.length < 1) return; + if (msg.trim().length < 1) return; //@ts-ignore this.clients.forEach(c => c.sendMsg(guacutils.encode("chat", client.username, msg))); this.ChatHistory.push({user: client.username, msg: msg}); @@ -500,7 +500,7 @@ export default class WSServer { status = "1"; } } else - if (!/^[a-zA-Z0-9\ \-\_\.]+$/.test(newName) || newName.length > 20 || newName.length < 3) { + if (!/^[a-zA-Z0-9\ \-\_\.]+$/.test(newName) || newName.length > 20 || newName.trim().length < 3) { client.assignGuestName(this.getUsernameList()); status = "2"; } else