mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Use preg_quote() to make spam words regex safe.
git-svn-id: https://develop.svn.wordpress.org/trunk@1896 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user