summaryrefslogtreecommitdiffstats
path: root/wp-includes/comment-template.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
commit0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch)
treee139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/comment-template.php
parentAdding upstream version 6.5.5+dfsg1. (diff)
downloadwordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.tar.xz
wordpress-0e41b5d52fdc6af6442816b5f465c9db9f84e126.zip
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/comment-template.php')
-rw-r--r--wp-includes/comment-template.php8
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;