mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Make spamfilter case-insensitive
This commit is contained in:
parent
1d0fb32923
commit
19dfa9a146
1 changed files with 2 additions and 2 deletions
|
|
@ -80,11 +80,11 @@ class spamfilterModel extends spamfilter
|
||||||
$word_list = $this->getDeniedWordList();
|
$word_list = $this->getDeniedWordList();
|
||||||
if(!count($word_list)) return new BaseObject();
|
if(!count($word_list)) return new BaseObject();
|
||||||
|
|
||||||
$text = utf8_trim(utf8_normalize_spaces(htmlspecialchars_decode(strip_tags($text, '<a><img>'))));
|
$text = strtolower(utf8_trim(utf8_normalize_spaces(htmlspecialchars_decode(strip_tags($text, '<a><img>')))));
|
||||||
foreach ($word_list as $word_item)
|
foreach ($word_list as $word_item)
|
||||||
{
|
{
|
||||||
$word = $word_item->word;
|
$word = $word_item->word;
|
||||||
if (strpos($text, $word) !== false)
|
if (strpos($text, strtolower($word)) !== false)
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->word = $word;
|
$args->word = $word;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue