From 1cb1a9bf7a9fbd2dc6165097c80e8e134cf95f53 Mon Sep 17 00:00:00 2001 From: Dougal Campbell Date: Thu, 27 May 2004 13:53:27 +0000 Subject: [PATCH] Fixed check_comment() to ignore empty lines in moderation_keys. git-svn-id: https://develop.svn.wordpress.org/trunk@1366 602fd350-edb4-49c9-b593-d223f7449a82 --- 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;