WordPress.org

Make WordPress Core

Ticket #1670: comment-functions.php.diff

File comment-functions.php.diff, 1.0 KB (added by markjaquith, 16 years ago)

patch for WP 1.6 SVN

  • comment-functions.php

     
    3838        $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];
    3939        $commentdata['comment_date'] = current_time('mysql');
    4040        $commentdata['comment_date_gmt'] = current_time('mysql', 1);
     41        $commentdata['user_ID'] = (int) $commentdata['user_ID'];
    4142
    4243        $commentdata = wp_filter_comment($commentdata);
    4344
     
    5051        if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
    5152                if ( '0' == $commentdata['comment_approved'] )
    5253                        wp_notify_moderator($comment_ID);
    53        
    54                 if ( get_settings('comments_notify') && $commentdata['comment_approved'] )
     54
     55                $post = &get_post($commentdata['comment_post_ID']);
     56
     57                if ( get_settings('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_ID'] )
    5558                        wp_notify_postauthor($comment_ID, $commentdata['comment_type']);
    5659        }
    5760