Use gravatar as a fallback for missing files
This commit is contained in:
parent
c7a4aaddfc
commit
52493a9a2b
@ -32,7 +32,8 @@ class GravatarPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
function onEndProfileGetAvatar($profile, $size, &$avatar)
|
function onEndProfileGetAvatar($profile, $size, &$avatar)
|
||||||
{
|
{
|
||||||
if (empty($avatar)) {
|
if (empty($avatar) ||
|
||||||
|
(!empty($avatar->filename) && !file_exists(Avatar::path($avatar->filename)))) {
|
||||||
$user = $profile->getUser();
|
$user = $profile->getUser();
|
||||||
if (!empty($user) && !empty($user->email)) {
|
if (!empty($user) && !empty($user->email)) {
|
||||||
// Fake one!
|
// Fake one!
|
||||||
|
Loading…
Reference in New Issue
Block a user