Add several columns to spamfilter IP & word tables for feature consistency and extensibility #1882

This commit is contained in:
Kijin Sung 2022-12-19 01:45:10 +09:00
parent e1f98e573c
commit 020b85168c
11 changed files with 94 additions and 30 deletions

View file

@ -211,6 +211,15 @@ class spamfilterAdminController extends spamfilter
{
continue;
}
if (preg_match('/^(.+?)#(.+)$/', $word, $matches))
{
$word = trim($matches[1]);
$description = trim($matches[2]);
}
else
{
$description = null;
}
if (mb_strlen($word, 'UTF-8') < 2 || mb_strlen($word, 'UTF-8') > 180)
{
@ -219,6 +228,8 @@ class spamfilterAdminController extends spamfilter
$args = new stdClass;
$args->word = $word;
$args->description = $description;
$args->is_regexp = preg_match('#^/.+/$#', $word) ? 'Y' : 'N';
$output = executeQuery('spamfilter.insertDeniedWord', $args);
if (!$output->toBool())
{