From 3e8d9d0cf0da905775fea8b500091bd862dcf02d Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 27 Apr 2005 23:55:06 +0000 Subject: [PATCH] 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 --- wp-includes/functions-post.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index e66f3ba573..2731befd04 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -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"); } -?> \ No newline at end of file +?>