Skip to content

Commit

Permalink
Porting change from #8053 to master
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <snipe@snipe.net>
  • Loading branch information
snipe committed May 27, 2020
1 parent 001e721 commit d14ab7e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/Presenters/UserPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,14 @@ public function gravatar()
return config('app.url').'/uploads/avatars/'.$this->avatar;
}

if ((Setting::getSettings()->load_remote=='1') && ($this->email!='')) {
$gravatar = md5(strtolower(trim($this->email)));
return "//gravatar.com/avatar/".$gravatar;
if (Setting::getSettings()->load_remote=='1') {
if ($this->model->gravatar!='') {
$gravatar = md5(strtolower(trim($this->model->gravatar)));
return "//gravatar.com/avatar/".$gravatar;
} elseif ($this->email!='') {
$gravatar = md5(strtolower(trim($this->email)));
return "//gravatar.com/avatar/".$gravatar;
}
}

// Set a fun, gender-neutral default icon
Expand Down

0 comments on commit d14ab7e

Please sign in to comment.