Skip to content

Commit 4d3c2a9

Browse files
committed
Auth: Fix locale field when logging with facebook
1 parent 580b90a commit 4d3c2a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main/auth/external_login/facebook.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function facebookConnect()
3131
$fb = new Facebook([
3232
'app_id' => $GLOBALS['facebook_config']['appId'],
3333
'app_secret' => $GLOBALS['facebook_config']['secret'],
34-
'default_graph_version' => 'v2.2',
34+
'default_graph_version' => 'v21.0',
3535
]);
3636

3737
$helper = $fb->getRedirectLoginHelper();
@@ -115,10 +115,10 @@ function facebookConnect()
115115
}
116116

117117
$user = $response->getGraphUser();
118-
$language = facebookPluginGetLanguage($user['locale']);
118+
$language = facebookPluginGetLanguage($user->getField('locale', ''));
119119

120120
if (!$language) {
121-
$language = 'en_US';
121+
$language = 'english';
122122
}
123123

124124
$u = [

0 commit comments

Comments
 (0)