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

git-svn-id: https://develop.svn.wordpress.org/trunk@2576 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-04-27 23:55:06 +00:00
parent 41b7c1ba73
commit e932142953

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) )
$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 ) )
if ( $userdata && ( $user_id == $post_author || $userdata->user_level >= 9 ) ) {
$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);
@ -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");
}
?>
?>