Fix comment auto-approval for authors/admins. http://mosquito.wordpress.org/view.php?id=1291 Props: kim, coffee2code

git-svn-id: http://svn.automattic.com/wordpress/trunk@2576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-04-27 23:55:06 +00:00
parent ebdf64dce2
commit 3e8d9d0cf0
1 changed files with 10 additions and 8 deletions

View File

@ -502,14 +502,16 @@ function wp_new_comment( $commentdata, $spam = false ) {
} }
} }
if ( check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) ) if ( $userdata && ( $user_id == $post_author || $userdata->user_level >= 9 ) ) {
$approved = 1;
else
$approved = 0;
if ( wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) )
$approved = 'spam';
if ( $userdata && ( $user_id == $post_author || $userdata['user_level'] >= 9 ) )
$approved = 1; $approved = 1;
} else {
if ( check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) )
$approved = 1;
else
$approved = 0;
if ( wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) )
$approved = 'spam';
}
$approved = apply_filters('pre_comment_approved', $approved); $approved = apply_filters('pre_comment_approved', $approved);
@ -603,4 +605,4 @@ function add_ping($post_id, $uri) { // Add a URI to those already pung
return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id"); return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
} }
?> ?>