Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/textpattern.php

    r12100 r12270  
    398398                                $message = $wpdb->escape($message);
    399399
    400                                 if($cinfo = comment_exists($name, $posted))
    401                                 {
     400                                $comment = array(
     401                                                        'comment_post_ID'       => $comment_post_ID,
     402                                                        'comment_author'        => $name,
     403                                                        'comment_author_IP'     => $ip,
     404                                                        'comment_author_email'  => $email,
     405                                                        'comment_author_url'    => $web,
     406                                                        'comment_date'          => $posted,
     407                                                        'comment_content'       => $message,
     408                                                        'comment_approved'      => $comment_approved);
     409                                $comment = wp_filter_comment($comment);
     410
     411                                if ( $cinfo = comment_exists($name, $posted) ) {
    402412                                        // Update comments
    403                                         $ret_id = wp_update_comment(array(
    404                                                 'comment_ID'                    => $cinfo,
    405                                                 'comment_post_ID'               => $comment_post_ID,
    406                                                 'comment_author'                => $name,
    407                                                 'comment_author_email'  => $email,
    408                                                 'comment_author_url'    => $web,
    409                                                 'comment_date'                  => $posted,
    410                                                 'comment_content'               => $message,
    411                                                 'comment_approved'              => $comment_approved)
    412                                                 );
    413                                 }
    414                                 else
    415                                 {
     413                                        $comment['comment_ID'] = $cinfo;
     414                                        $ret_id = wp_update_comment($comment);
     415                                } else {
    416416                                        // Insert comments
    417                                         $ret_id = wp_insert_comment(array(
    418                                                 'comment_post_ID'               => $comment_post_ID,
    419                                                 'comment_author'                => $name,
    420                                                 'comment_author_email'  => $email,
    421                                                 'comment_author_url'    => $web,
    422                                                 'comment_author_IP'             => $ip,
    423                                                 'comment_date'                  => $posted,
    424                                                 'comment_content'               => $message,
    425                                                 'comment_approved'              => $comment_approved)
    426                                                 );
     417                                        $ret_id = wp_insert_comment($comment);
    427418                                }
    428419                                $txpcm2wpcm[$comment_ID] = $ret_id;
Note: See TracChangeset for help on using the changeset viewer.