From c02d589e364efcad6da48fb57a15df8d9c5282c0 Mon Sep 17 00:00:00 2001 From: rboren Date: Sun, 28 Nov 2004 05:24:09 +0000 Subject: [PATCH] Use preg_quote() to make spam words regex safe. git-svn-id: http://svn.automattic.com/wordpress/trunk@1896 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2802b87a4..db2ab195f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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;