From 7b0d083b53f2e93cf0faf03c1c7649b0851f52aa Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 13 Jan 2026 11:59:56 -0800 Subject: [PATCH] add check to prevent md5 from running with no author name --- disqus/rest-api/class-disqus-rest-api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disqus/rest-api/class-disqus-rest-api.php b/disqus/rest-api/class-disqus-rest-api.php index 01b4a53..aa1d433 100644 --- a/disqus/rest-api/class-disqus-rest-api.php +++ b/disqus/rest-api/class-disqus-rest-api.php @@ -786,7 +786,8 @@ private function comment_data_from_post( $post ) { if ( isset( $author['email'] ) ) { $author_email = $author['email']; } elseif ( isset( $author['isAnonymous'] ) && $author['isAnonymous'] ) { - $author_email = 'anonymized-' . md5( $author['name'] ) . '@disqus.com'; + $author_name = isset( $author['name'] ) && null !== $author['name'] ? $author['name'] : 'anonymous'; + $author_email = 'anonymized-' . md5( $author_name ) . '@disqus.com'; } elseif ( isset( $author['id'] ) ) { $author_email = 'user-' . $author['id'] . '@disqus.com'; }