Make WordPress Core


Ignore:
Timestamp:
04/20/2005 03:37:23 AM (19 years ago)
Author:
matt
Message:

Line ending fixes and commenting cleanups from Scott Reilly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-post.php

    r2523 r2556  
    481481    $now_gmt = current_time('mysql', 1);
    482482
     483    if ( $user_id ) {
     484        $userdata = get_userdata($user_id);
     485        $post_author = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = '$comment_post_ID' LIMIT 1");
     486    }
     487
    483488    // Simple flood-protection
    484489    if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$user_ip' OR comment_author_email = '$email' ORDER BY comment_date DESC LIMIT 1") ) {
     
    497502    if ( wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) )
    498503        $approved = 'spam';
    499    
     504    if ( $userdata && ( $user_id == $post_author || $userdata['user_level'] >= 9 ) )
     505        $approved = 1;
     506
    500507    $approved = apply_filters('pre_comment_approved', $approved);
    501508
Note: See TracChangeset for help on using the changeset viewer.