whoops, we forgot to store the comment_type

git-svn-id: https://develop.svn.wordpress.org/trunk@1716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
michelvaldrighi 2004-09-27 11:45:15 +00:00
parent 43a8441b9c
commit bb232bd2d9
1 changed files with 6 additions and 2 deletions

View File

@ -377,6 +377,10 @@ function wp_new_comment($commentdata) {
$now_gmt = current_time('mysql', 1); $now_gmt = current_time('mysql', 1);
$user_agent = addslashes($_SERVER['HTTP_USER_AGENT']); $user_agent = addslashes($_SERVER['HTTP_USER_AGENT']);
if ( (!isset($comment_type)) || (($comment_type != 'trackback') && ($comment_type != 'pingback')) ) {
$comment_type = '';
}
// Simple flood-protection // Simple flood-protection
if ( $lasttime = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1") ) { if ( $lasttime = $wpdb->get_var("SELECT comment_date FROM $wpdb->comments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1") ) {
$time_lastcomment= mysql2date('U', $lasttime); $time_lastcomment= mysql2date('U', $lasttime);
@ -391,9 +395,9 @@ function wp_new_comment($commentdata) {
$approved = 0; $approved = 0;
$result = $wpdb->query("INSERT INTO $wpdb->comments $result = $wpdb->query("INSERT INTO $wpdb->comments
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent) (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type)
VALUES VALUES
('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$user_ip', '$now', '$now_gmt', '$comment_content', '$approved', '$user_agent') ('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$user_ip', '$now', '$now_gmt', '$comment_content', '$approved', '$user_agent', '$comment_type')
"); ");
if ( get_option('comments_notify') ) if ( get_option('comments_notify') )