Check that $user_id is set. For non-logged in users it is not set so we get a notice.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-12-13 11:43:19 +00:00
parent 5d087be7e9
commit a43c737a0d
1 changed files with 1 additions and 1 deletions

View File

@ -506,7 +506,7 @@ function wp_allow_comment($commentdata) {
do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
if ( $user_id ) {
if ( isset($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));