Porting change from #8053 to master

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2020-05-27 00:22:44 -07:00
parent 001e721530
commit d14ab7e3e1
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -324,10 +324,15 @@ class UserPresenter extends Presenter
return config('app.url').'/uploads/avatars/'.$this->avatar;
}
if ((Setting::getSettings()->load_remote=='1') && ($this->email!='')) {
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
return url('/').'/img/default-sm.png';