BUGFIX: prevent '#' chars in moderation_keys from breaking regex handling.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6386e0815c
commit
064edd94ae
@ -1677,7 +1677,11 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
|
|||||||
// Skip empty lines
|
// Skip empty lines
|
||||||
if (empty($word)) { continue; }
|
if (empty($word)) { continue; }
|
||||||
|
|
||||||
$pattern = "#$word#i";
|
// Do some escaping magic so that '#' chars in the
|
||||||
|
// spam words don't break things:
|
||||||
|
$word = preg_replace('/(\\\\|#)/','\\\\$1',$word);
|
||||||
|
|
||||||
|
$pattern = "#$word#i";
|
||||||
if ( preg_match($pattern, $author) ) return false;
|
if ( preg_match($pattern, $author) ) return false;
|
||||||
if ( preg_match($pattern, $email) ) return false;
|
if ( preg_match($pattern, $email) ) return false;
|
||||||
if ( preg_match($pattern, $url) ) return false;
|
if ( preg_match($pattern, $url) ) return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user