From 34398e5a2e173e3d62500cef13fdc05ef334ec6d Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 17 Feb 2006 01:00:18 +0000 Subject: [PATCH] Make sure user_id is set before inserting. Props bungeman. fixes #2459 git-svn-id: http://svn.automattic.com/wordpress/trunk@3537 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index efe4c9582..a61610aea 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -78,6 +78,8 @@ function wp_insert_comment($commentdata) { $comment_parent = 0; if ( ! isset($comment_approved) ) $comment_approved = 1; + if ( ! isset($user_id) ) + $user_id = 0; $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_type, comment_parent, user_id)