WordPress.org

Make WordPress Core

Ticket #33947: comment-template.php.diff

File comment-template.php.diff, 765 bytes (added by walterebert, 6 years ago)
  • trunk/src/wp-includes/comment-template.php

     
    441441        $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type;
    442442
    443443        // Add classes for comment authors that are registered users.
    444         if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) {
     444        if ( ! empty( $comment->user_id ) && $user = get_userdata( $comment->user_id ) ) {
    445445                $classes[] = 'byuser';
    446446                $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id );
    447447                // For comment authors who are the author of the post