mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix #2051 include document extra vars in spamfilter target
This commit is contained in:
parent
56e94fac7d
commit
0f12a10b05
1 changed files with 13 additions and 6 deletions
|
|
@ -55,16 +55,23 @@ class spamfilterController extends spamfilter
|
|||
$output = $oFilterModel->isDeniedIP();
|
||||
if(!$output->toBool()) return $output;
|
||||
// Check if there is a ban on the word
|
||||
$text = '';
|
||||
if($is_logged)
|
||||
$filter_targets = [$obj->title, $obj->content, $obj->tags ?? ''];
|
||||
if(!$is_logged)
|
||||
{
|
||||
$text = $obj->title . ' ' . $obj->content . ' ' . $obj->tags;
|
||||
$filter_targets[] = $obj->nick_name;
|
||||
$filter_targets[] = $obj->homepage;
|
||||
}
|
||||
else
|
||||
foreach ($obj as $key => $val)
|
||||
{
|
||||
$text = $obj->title . ' ' . $obj->content . ' ' . $obj->nick_name . ' ' . $obj->homepage . ' ' . $obj->tags;
|
||||
if (preg_match('/^extra_vars\d+$/', $key) && !empty($val))
|
||||
{
|
||||
foreach (is_array($val) ? $val : explode('|@|', $val) as $fragment)
|
||||
{
|
||||
$filter_targets[] = $fragment;
|
||||
}
|
||||
}
|
||||
}
|
||||
$output = $oFilterModel->isDeniedWord($text);
|
||||
$output = $oFilterModel->isDeniedWord(implode("\n", $filter_targets));
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue