diff options
Diffstat (limited to 'wp-includes/comment-template.php')
-rw-r--r-- | wp-includes/comment-template.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index d125f0c..fed6568 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -24,7 +24,13 @@ function get_comment_author( $comment_id = 0 ) { $comment = get_comment( $comment_id ); - $comment_id = ! empty( $comment->comment_ID ) ? $comment->comment_ID : $comment_id; + if ( ! empty( $comment->comment_ID ) ) { + $comment_id = $comment->comment_ID; + } elseif ( is_scalar( $comment_id ) ) { + $comment_id = (string) $comment_id; + } else { + $comment_id = ''; + } if ( empty( $comment->comment_author ) ) { $user = ! empty( $comment->user_id ) ? get_userdata( $comment->user_id ) : false; |