From 7de632db35292bb391b4355dbc596ba1e109d527 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 6 Feb 2022 22:40:42 +0100 Subject: [PATCH] update avatar url --- src/Entity/Blog/Comment.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Entity/Blog/Comment.php b/src/Entity/Blog/Comment.php index d6167c8..bbc51db 100644 --- a/src/Entity/Blog/Comment.php +++ b/src/Entity/Blog/Comment.php @@ -211,7 +211,10 @@ class Comment implements EntityInterface */ public function getAvatar(): string { - return 'https://secure.gravatar.com/avatar/'.md5($this->getEmail() ?? 'undefined@undefined').'.jpg?s=90&d=retro'; + $mail = $this->getEmail() ?? sprintf('%d@deblan.io', $this->getId()); + $hash = md5($mail); + + return 'https://cdn.libravatar.org/avatar/'.$hash.'?s=90&d=retro'; } /**