From 7c7ee0d378cf223abd3e2f8fbf4d51fa1fcd1939 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 10 一月 2026 13:25:00 +0800
Subject: [PATCH] 0312 区分取名和聊天的特殊符号屏蔽;其他看表配置
---
Main/Utility/UIHelper.cs | 13 +++++++++++++
Main/System/Chat/ChatManager.cs | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/Main/System/Chat/ChatManager.cs b/Main/System/Chat/ChatManager.cs
index 6630b36..97b146c 100644
--- a/Main/System/Chat/ChatManager.cs
+++ b/Main/System/Chat/ChatManager.cs
@@ -260,7 +260,7 @@
return false;
}
- if (DirtyWordConfig.IsDirtWord(info) || UIHelper.HasSpecialCharac(info)
+ if (DirtyWordConfig.IsDirtWord(info) || UIHelper.HasSpecCheckChat(info)
|| DirtyNameConfig.IsDirtName(info))
{
errorCode = 3;
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 8b6c868..e685d0d 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -335,6 +335,8 @@
}
}
+
+ // 鍙栧悕楠岃瘉
static Regex s_SpecialCharacterRegex = new Regex("[()锛堬級@!#$%^&*[]|_]");
static Regex s_AsciiCharacterRegex = new Regex("[\x00-\x1F]|[\x21-\x2F]|[\x3A-\x40]|[\x5B-\x60]|[\x7B-\x7E]");
public static bool HasSpecialCharac(string str)
@@ -350,6 +352,17 @@
return false;
}
+ //鑱婂ぉ
+ static Regex s_AsciiCharacterRegexChat = new Regex("[\x00-\x1F]");
+ public static bool HasSpecCheckChat(string str)
+ {
+ if (s_AsciiCharacterRegexChat.IsMatch(str))
+ {
+ return true;
+ }
+ return false;
+ }
+
// 妫�鏌ュ瓧绗︿覆鏄笉鏄函鏁存暟
public static bool IsNumeric(string input)
{
--
Gitblit v1.8.0