From 00f7cb9dbbfd7301fdb89157846f7d68355b3e50 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 4 Jul 2024 16:46:12 +0100 Subject: [PATCH] Reverse the order for default gravatar Signed-off-by: snipe --- app/Presenters/UserPresenter.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index f60db150a1db..ddd72ea2c84a 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -445,7 +445,11 @@ public function gravatar() return Storage::disk('public')->url('avatars/'.e($this->avatar)); } - + // If there is a default avatar + if (Setting::getSettings()->default_avatar!= '') { + return Storage::disk('public')->url('avatars/'.e(Setting::getSettings()->default_avatar)); + } + // Fall back to Gravatar if the settings allow loading remote scripts if (Setting::getSettings()->load_remote == '1') { if ($this->model->gravatar != '') { @@ -460,10 +464,7 @@ public function gravatar() } } - // If there is a default avatar - if (Setting::getSettings()->default_avatar!= '') { - return Storage::disk('public')->url('avatars/'.e(Setting::getSettings()->default_avatar)); - } + return false; }