diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index e66f3ba57..2731befd0 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 +?>