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
This commit is contained in:
parent
557fe886cd
commit
48250cd478
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue