Fix Notice on comment posting.

git-svn-id: https://develop.svn.wordpress.org/trunk@10042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-12-04 20:26:05 +00:00
parent e9431babe7
commit d1926da5bb

View File

@ -421,7 +421,7 @@ function wp_allow_comment($commentdata) {
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
}
if ( $userdata && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
if ( isset($userdata) && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
// The author and the admins get respect.
$approved = 1;
} else {