Make WordPress Core


Ignore:
Timestamp:
08/24/2008 06:56:22 AM (17 years ago)
Author:
azaozz
Message:

Reply to comments from admin, first run, see #7435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r8622 r8720  
    392392        $dupe .= "OR comment_author_email = '$comment_author_email' ";
    393393    $dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
    394     if ( $wpdb->get_var($dupe) )
     394    if ( $wpdb->get_var($dupe) ) {
     395        if ( defined('DOING_AJAX') )
     396            die( __('Duplicate comment detected; it looks as though you\'ve already said that!') );
     397
    395398        wp_die( __('Duplicate comment detected; it looks as though you\'ve already said that!') );
     399    }
    396400
    397401    do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
     
    444448        if ( $flood_die ) {
    445449            do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment);
     450
     451            if ( defined('DOING_AJAX') )
     452                die( __('You are posting comments too quickly.  Slow down.') );
     453
    446454            wp_die( __('You are posting comments too quickly.  Slow down.') );
    447455        }
     
    753761    $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    754762    $commentdata['user_ID']         = (int) $commentdata['user_ID'];
     763
     764    $commentdata['comment_parent'] = absint($commentdata['comment_parent']);
     765    $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
     766    $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
    755767
    756768    $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
Note: See TracChangeset for help on using the changeset viewer.