Make sure user_id is set before inserting. Props bungeman. fixes #2459

git-svn-id: https://develop.svn.wordpress.org/trunk@3537 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-02-17 01:00:18 +00:00
parent 99cf0b7b90
commit cb87fb3b7f
1 changed files with 2 additions and 0 deletions

View File

@ -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)