If more than X links in a comment, moderate that sucker.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1577,6 +1577,11 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
|
||||
if ( preg_match($pattern, $comment) ) return false;
|
||||
if ( preg_match($pattern, $user_ip) ) return false;
|
||||
}
|
||||
|
||||
preg_match_all('|([\n ])([a-z]+?)://([^, <>{}\n\r]+)|i', $comment, $all_links);
|
||||
$number = count($all_links[0]);
|
||||
if ($number >= get_settings('comment_max_links')) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user