From 48250cd47808667ae70cc2201da29483a9fbbd18 Mon Sep 17 00:00:00 2001 From: emc3 Date: Thu, 27 May 2004 13:53:27 +0000 Subject: [PATCH] Fixed check_comment() to ignore empty lines in moderation_keys. git-svn-id: http://svn.automattic.com/wordpress/trunk@1366 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f4c573d7d5..a3a6cc4a8a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1342,8 +1342,12 @@ function check_comment($author, $email, $url, $comment, $user_ip) { if ('' == trim( get_settings('moderation_keys') ) ) return true; // If moderation keys are empty $words = explode("\n", get_settings('moderation_keys') ); foreach ($words as $word) { - $word = trim($word); - $pattern = "#$word#i"; + $word = trim($word); + + // Skip empty lines + if (empty($word)) { continue; } + + $pattern = "#$word#i"; if ( preg_match($pattern, $author) ) return false; if ( preg_match($pattern, $email) ) return false; if ( preg_match($pattern, $url) ) return false;