From 2dbb931dea09d74128f799eaa765f53092f12b5e Mon Sep 17 00:00:00 2001 From: sch-lda <54973190+sch-lda@users.noreply.github.com> Date: Wed, 5 Jun 2024 21:51:35 +0800 Subject: [PATCH] fix(Chat Filter): also lowercase incoming text (#3225) --- src/util/chat.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/chat.hpp b/src/util/chat.hpp index 307ebaae..83662de8 100644 --- a/src/util/chat.hpp +++ b/src/util/chat.hpp @@ -143,7 +143,9 @@ namespace big::chat { std::string e_str(e); std::transform(e_str.begin(), e_str.end(), e_str.begin(), ::tolower); - if (strstr(text, e_str.c_str()) != 0) + std::string text_str(text); + std::transform(text_str.begin(), text_str.end(), text_str.begin(), ::tolower); + if (strstr(text_str.c_str(), e_str.c_str()) != 0) return SpamReason::STATIC_DETECTION; } return SpamReason::NOT_A_SPAMMER;