fix(Chat Filter): also lowercase incoming text (#3225)
Some checks failed
Nightly Build / Check Recent Commit (push) Successful in 47s
Nightly Build / Build Nightly (push) Has been cancelled
Nightly Build / Recreate Release (push) Has been cancelled

This commit is contained in:
sch-lda 2024-06-05 21:51:35 +08:00 committed by GitHub
parent 4adcc05cf3
commit 8bbab4c765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;