mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
Strip HTML and normalize spaces before checking text for blocked words
This commit is contained in:
parent
68c0ce3ae6
commit
b4d7d4e2c0
1 changed files with 2 additions and 1 deletions
|
|
@ -53,6 +53,7 @@ class spamfilterController extends spamfilter
|
||||||
{
|
{
|
||||||
$text = $obj->title . ' ' . $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage . ' ' . $obj->tags;
|
$text = $obj->title . ' ' . $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage . ' ' . $obj->tags;
|
||||||
}
|
}
|
||||||
|
$text = utf8_trim(utf8_normalize_spaces(htmlspecialchars_decode(strip_tags($text))));
|
||||||
$output = $oFilterModel->isDeniedWord($text);
|
$output = $oFilterModel->isDeniedWord($text);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// Check the specified time beside the modificaiton time
|
// Check the specified time beside the modificaiton time
|
||||||
|
|
@ -89,7 +90,6 @@ class spamfilterController extends spamfilter
|
||||||
$output = $oFilterModel->isDeniedIP();
|
$output = $oFilterModel->isDeniedIP();
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// Check if there is a ban on the word
|
// Check if there is a ban on the word
|
||||||
$text = '';
|
|
||||||
if($is_logged)
|
if($is_logged)
|
||||||
{
|
{
|
||||||
$text = $obj->content;
|
$text = $obj->content;
|
||||||
|
|
@ -98,6 +98,7 @@ class spamfilterController extends spamfilter
|
||||||
{
|
{
|
||||||
$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;
|
$text = $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage;
|
||||||
}
|
}
|
||||||
|
$text = utf8_trim(utf8_normalize_spaces(htmlspecialchars_decode(strip_tags($text))));
|
||||||
$output = $oFilterModel->isDeniedWord($text);
|
$output = $oFilterModel->isDeniedWord($text);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// If the specified time check is not modified
|
// If the specified time check is not modified
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue