Make WordPress Core

Changeset 12270


Ignore:
Timestamp:
11/24/2009 02:40:25 PM (16 years ago)
Author:
ryan
Message:

Filter imported comments

Location:
trunk/wp-admin/import
Files:
4 edited

Legend:

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

    r12104 r12270  
    623623            $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
    624624
     625            $comment = wp_filter_comment($comment);
    625626            $comment_id = wp_insert_comment($comment);
    626627
  • trunk/wp-admin/import/dotclear.php

    r12100 r12270  
    414414                $message = $wpdb->escape(textconv ($comment_content));
    415415
    416                 if($cinfo = comment_exists($name, $comment_dt))
    417                 {
    418                     // Update comments
    419                     $ret_id = wp_update_comment(array(
    420                             'comment_ID'        => $cinfo,
     416                $comment = array(
    421417                            'comment_post_ID'   => $comment_post_ID,
    422418                            'comment_author'    => $name,
     
    427423                            'comment_date_gmt'  => $comment_dt,
    428424                            'comment_content'   => $message,
    429                             'comment_approved'  => $comment_approved)
    430                             );
    431                 }
    432                 else
    433                 {
     425                            'comment_approved'  => $comment_approved);
     426                $comment = wp_filter_comment($comment);
     427
     428                if ( $cinfo = comment_exists($name, $comment_dt) ) {
     429                    // Update comments
     430                    $comment['comment_ID'] = $cinfo;
     431                    $ret_id = wp_update_comment($comment);
     432                } else {
    434433                    // Insert comments
    435                     $ret_id = wp_insert_comment(array(
    436                             'comment_post_ID'   => $comment_post_ID,
    437                             'comment_author'    => $name,
    438                             'comment_author_email'  => $email,
    439                             'comment_author_url'    => $web,
    440                             'comment_author_IP' => $comment_ip,
    441                             'comment_date'      => $comment_dt,
    442                             'comment_date_gmt'  => $comment_dt,
    443                             'comment_content'   => $message,
    444                             'comment_approved'  => $comment_approved)
    445                             );
     434                    $ret_id = wp_insert_comment($comment);
    446435                }
    447436                $dccm2wpcm[$comment_ID] = $ret_id;
  • trunk/wp-admin/import/livejournal.php

    r12104 r12270  
    536536                // Parse this comment into an array and insert
    537537                $comment = $this->parse_comment( $comment );
     538                $comment = wp_filter_comment( $comment );
    538539                $id = wp_insert_comment( $comment );
    539540
  • 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.