Make spamfilter case-insensitive

This commit is contained in:
Kijin Sung 2018-08-08 18:00:48 +09:00
parent 1d0fb32923
commit 19dfa9a146

View file

@ -80,11 +80,11 @@ class spamfilterModel extends spamfilter
$word_list = $this->getDeniedWordList();
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)
{
$word = $word_item->word;
if (strpos($text, $word) !== false)
if (strpos($text, strtolower($word)) !== false)
{
$args = new stdClass();
$args->word = $word;