Fix for avatar_url provided by 3rd party providers

This commit is contained in:
Andy Miller 2019-04-26 13:11:28 -06:00
parent f30334d80f
commit 4d6db5b334
No known key found for this signature in database
GPG Key ID: E82B8D0EAB94EFB9
2 changed files with 7 additions and 5 deletions

View File

@ -7,6 +7,7 @@
1. [](#bugfix)
* Fixed `$grav['route']` from being modified when the route instance gets modified
* Fixed Assets options array mixed with standalone priority [#2477](https://github.com/getgrav/grav/issues/2477)
* Fix for `avatar_url` provided by 3rd party providers
# v1.6.8
## 04/23/2019

View File

@ -148,12 +148,13 @@ trait UserTrait
// Try looking for provider.
$provider = $this->get('provider');
if (\is_array($provider)) {
if (isset($provider['avatar_url']) && \is_string($provider['avatar_url'])) {
return $provider['avatar_url'];
$provider_options = $this->get($provider);
if (\is_array($provider_options)) {
if (isset($provider_options['avatar_url']) && \is_string($provider_options['avatar_url'])) {
return $provider_options['avatar_url'];
}
if (isset($provider['avatar']) && \is_string($provider['avatar'])) {
return $provider['avatar'];
if (isset($provider_options['avatar']) && \is_string($provider_options['avatar'])) {
return $provider_options['avatar'];
}
}