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;