Use preg_quote() to make spam words regex safe.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2625010626
commit
c02d589e36
|
@ -1732,7 +1732,7 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent) {
|
|||
|
||||
// Do some escaping magic so that '#' chars in the
|
||||
// spam words don't break things:
|
||||
$word = preg_replace('/(\\\\|#)/','\\\\$1',$word);
|
||||
$word = preg_quote($word, '#');
|
||||
|
||||
$pattern = "#$word#i";
|
||||
if ( preg_match($pattern, $author) ) return false;
|
||||
|
|
Loading…
Reference in New Issue