Ticket #23482: 23482.patch
File 23482.patch, 1.3 KB (added by , 10 years ago) |
---|
-
dotclear-importer.php
33 33 } 34 34 } 35 35 36 if(!function_exists('get_comment_ID')) 37 { 38 /** 39 * Get the comment count for posts. 40 * 41 * @package WordPress 42 * @subpackage Textpattern_Import 43 * 44 * @param int $post_ID Post ID 45 * @return int 46 */ 47 function get_comment_ID($comment_author, $comment_date) 48 { 49 global $wpdb; 50 $comment_author = stripslashes($comment_author); 51 $comment_date = stripslashes($comment_date); 52 return $wpdb->get_var( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) ); 53 } 54 } 55 36 56 if (!function_exists('link_exists')) { 37 57 /** 38 58 * Check whether link already exists. … … 413 433 'comment_approved' => $comment_approved); 414 434 $comment = wp_filter_comment($comment); 415 435 416 if ( $cinfo =comment_exists($name, $comment_dt) ) {436 if ( comment_exists($name, $comment_dt) ) { 417 437 // Update comments 418 $comment['comment_ID'] = $cinfo;438 $comment['comment_ID'] = get_comment_ID($name, $comment_dt); 419 439 $ret_id = wp_update_comment($comment); 420 440 } else { 421 441 // Insert comments