From 81edd5a7289898daaa205c6fffa56889f6ef0102 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 13 Dec 2009 17:32:14 +0000 Subject: [PATCH] Restore the check for trueness on $user_id so we don't run the queries or create the objects. Fixes #11419 props Denis-de-Bernardy. git-svn-id: https://develop.svn.wordpress.org/trunk@12391 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 81f317f06b..4e641862c2 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -506,7 +506,7 @@ function wp_allow_comment($commentdata) { do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt ); - if ( isset($user_id) ) { + if ( isset($user_id) && $user_id) { $userdata = get_userdata($user_id); $user = new WP_User($user_id); $post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));