Skip to content

Commit e3f9802

Browse files
Merge branch 'v3'
2 parents b098701 + 42747d2 commit e3f9802

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/Providers/Discord/Discord.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Discord extends OAuth implements UserProfilesInterface, UserPicturesInterf
8484
'MANAGE_NICKNAMES' => 0x08000000,
8585
'MANAGE_ROLES' => 0x10000000,
8686
'MANAGE_WEBHOOKS' => 0x20000000,
87-
'MANAGE_EMOJIS' => 0x40000000
87+
'MANAGE_EMOJIS' => 0x40000000,
8888
];
8989

9090
/**
@@ -101,7 +101,8 @@ public function getUserProfile(): UserProfile
101101
$user->response = $response;
102102
$user->username = $response->username . '#' . $response->discriminator;
103103
$user->name = $response->username;
104-
$user->email_addresses = [$response->email];
104+
$user->email_addresses = [];
105+
if (isset($response->email)) array_push($user->email_addresses, $response->email);
105106

106107
return $user;
107108
}

src/Providers/GitLab/GitLab.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function getUserPictureUrl(int $size = 50): ?string
101101

102102
if (!isset($response->avatar_url)) return null;
103103

104-
return $response->avatar_url . ($size ? '&size=' . $size : '');
104+
return $response->avatar_url .
105+
($size ? (strpos($response->avatar_url, '?') !== false ? '&' : '?') . 'size=' . $size : '');
105106
}
106107
}

src/Providers/Mastodon/Mastodon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Mastodon extends OAuth implements UserProfilesInterface, UserPicturesInter
3636
*
3737
* @var string
3838
*/
39-
public $base_api_endpoint = 'https://mastodon.social';
39+
public $base_api_endpoint = 'https://mastodon.social/api/v1/';
4040

4141
/**
4242
* OAuth 2.0 authorise endpoint.

src/TokenEndpoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function createAccessTokenFromSuccessfulResponse(stdClass $response, a
2727
$refresh_token = isset($response->refresh_token) ? $response->refresh_token : null;
2828
$expires = isset($response->expires_in) ? time() + $response->expires_in : null;
2929
$scope = !isset($response->scope) ? $requested_scope :
30-
strlen($response->scope) === 0 ? [] : explode($this->scope_separator, $response->scope);
30+
(strlen($response->scope) === 0 ? [] : explode($this->scope_separator, $response->scope));
3131

3232
$token = new AccessToken($response->access_token, $refresh_token, $expires, $scope);
3333
$token->response = $response;

0 commit comments

Comments
 (0)