Comment count patch from Kitty. http://poker.mookitty.co.uk/
git-svn-id: http://svn.automattic.com/wordpress/trunk@1252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
169764be37
commit
fbd7cc9b6d
|
@ -1334,6 +1334,10 @@ function get_posts($args) {
|
|||
|
||||
function check_comment($author, $email, $url, $comment, $user_ip) {
|
||||
if (1 == get_settings('comment_moderation')) return false; // If moderation is set to manual
|
||||
|
||||
if ( (count(explode('http:', $comment)) - 1) >= get_settings('comment_max_links') )
|
||||
return false; // Check # of external links
|
||||
|
||||
if ('' == trim( get_settings('moderation_keys') ) ) return true; // If moderation keys are empty
|
||||
$words = explode("\n", get_settings('moderation_keys') );
|
||||
foreach ($words as $word) {
|
||||
|
@ -1346,10 +1350,6 @@ function check_comment($author, $email, $url, $comment, $user_ip) {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue