Make WordPress Core

Ticket #10653: comment-template.patch

File comment-template.patch, 773 bytes (added by prettyboymp, 15 years ago)
  • comment-template.php

     
    2121 */
    2222function get_comment_author() {
    2323        global $comment;
    24         if ( empty($comment->comment_author) ) {
    25                 if (!empty($comment->user_id)){
    26                         $user=get_userdata($comment->user_id);
    27                         $author=$user->user_login;
    28                 } else {
    29                         $author = __('Anonymous');
     24        $author = __('Anonymous');
     25        if (!empty($comment->user_id)){
     26                $user=get_userdata($comment->user_id);
     27                if($user)
     28                {
     29                        $author=$user->display_name;
    3030                }
    31         } else {
     31        } else if(!empty($comment->comment_author)) {
    3232                $author = $comment->comment_author;
    3333        }
    3434        return apply_filters('get_comment_author', $author);