mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
when delete spam word, check length
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12540 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7b0c09b083
commit
3e97b309de
3 changed files with 14 additions and 7 deletions
|
|
@ -23,7 +23,7 @@
|
|||
<action name="dispSpamfilterAdminConfigBlock" type="view" standalone="true" menu_name="spamFilter" />
|
||||
|
||||
<action name="procSpamfilterAdminInsertDeniedIP" type="controller" standalone="true" ruleset="insertDeniedIp" />
|
||||
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" ruleset="insertDeniedWord" />
|
||||
<action name="procSpamfilterAdminInsertDeniedWord" type="controller" standalone="true" />
|
||||
|
||||
<action name="procSpamfilterAdminDeleteDeniedIP" type="controller" standalone="true" ruleset="deleteDeniedIp" />
|
||||
<action name="procSpamfilterAdminDeleteDeniedWord" type="controller" standalone="true" ruleset="deleteDeniedWord" />
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
<rule name="word" type="regex" test="/^(.{2,40}[\r\n]+)*.{2,40}$/" />
|
||||
<customrules>
|
||||
<rule name="word" type="regex" test="/^(.{2,40}[\r\n]+)*.{2,40}$/" />
|
||||
</customrules>
|
||||
<fields>
|
||||
<fields>
|
||||
<field name="act" required="true" default="procSpamfilterAdminDeleteDeniedWord" />
|
||||
<field name="word" required="true" rule="word" />
|
||||
</fields>
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
|
|||
|
|
@ -110,10 +110,17 @@ class spamfilterAdminController extends spamfilter
|
|||
*/
|
||||
function insertWord($word_list)
|
||||
{
|
||||
if(!preg_match("/^(.{2,40}\s*)*$/",$word_list)) return new Object(-1, 'msg_invalid');
|
||||
|
||||
$word_list = str_replace("\r","",$word_list);
|
||||
$word_list = explode("\n",$word_list);
|
||||
|
||||
foreach($word_list as $word)
|
||||
{
|
||||
if(!preg_match("/^(.{2,40}[\r\n]+)*.{2,40}$/", $word))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid');
|
||||
}
|
||||
}
|
||||
|
||||
$fail_word = '';
|
||||
foreach($word_list as $word)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue