New comment moderation code, for trackbacks and comments.

git-svn-id: http://svn.automattic.com/wordpress/trunk@984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt
2004-03-21 08:31:33 +00:00
parent 76dd5c2562
commit adbca5d4fc
5 changed files with 24 additions and 27 deletions

View File

@@ -1564,4 +1564,18 @@ function get_posts($args) {
return $posts;
}
function check_comment($author, $email, $url, $comment, $user_ip) {
$words = explode("\n", get_settings('moderation_keys') );
foreach ($words as $word) {
$word = trim($word);
$pattern = "#$word#i";
if ( preg_match($pattern, $author) ) return false;
if ( preg_match($pattern, $email) ) return false;
if ( preg_match($pattern, $url) ) return false;
if ( preg_match($pattern, $comment) ) return false;
if ( preg_match($pattern, $user_ip) ) return false;
}
return true;
}
?>