mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
17286540 스팸필터 단어를 정규표현식으로 검사시에 preg_quote($word,/)를 통해 quote 처리후 검사하도록 하여 오류 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4511 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4367598abe
commit
6264c16f44
1 changed files with 2 additions and 2 deletions
|
|
@ -47,7 +47,7 @@
|
|||
$patterns = array();
|
||||
for($i=0;$i<$count;$i++) {
|
||||
$ip = str_replace('*','',$ip_list[$i]->ipaddress);
|
||||
$patterns[] = $ip;
|
||||
$patterns[] = preg_quote($ip);
|
||||
}
|
||||
|
||||
$pattern = '/^('.implode($patterns,'|').')/';
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
$count = count($word_list);
|
||||
for($i=0;$i<$count;$i++) {
|
||||
$word = $word_list[$i]->word;
|
||||
if(preg_match('/'.$word.'/is', $text)) return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word));
|
||||
if(preg_match('/'.preg_quote($word,'/').'/is', $text)) return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word));
|
||||
}
|
||||
|
||||
return new Object();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue