From b1061f0165cbd27c9f957bb10d779c6a73aaddd3 Mon Sep 17 00:00:00 2001 From: Toes | Robin Ury <1146921+binury@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:18:03 -0400 Subject: [PATCH] Refactor: invert whitespace stripping pattern --- network/network_chat_protocol.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/network_chat_protocol.gd b/network/network_chat_protocol.gd index 6538295..389260d 100644 --- a/network/network_chat_protocol.gd +++ b/network/network_chat_protocol.gd @@ -15,7 +15,7 @@ enum Kind { PLAYER, SYSTEM } static func sanitize_body(value: Variant) -> String: if typeof(value) != TYPE_STRING: return "" - var strippable_whitespace = RegEx.create_from_string("^[\\s\\p{Z}\\p{Cf}\\x{2800}]+|[\\s\\p{Z}\\p{Cf}\\x{2800}]+$") + var strippable_whitespace = RegEx.create_from_string("^[^\\w]+|[^\\w]+$") var result := strippable_whitespace.sub(value, "") if result.is_empty() or result.length() > MAX_VISIBLE_CHARACTERS: return ""