diff --git a/src/applications/auth/controller/oauthregistration/default/PhabricatorOAuthDefaultRegistrationController.php b/src/applications/auth/controller/oauthregistration/default/PhabricatorOAuthDefaultRegistrationController.php index 816092c6dd..a748c3e274 100644 --- a/src/applications/auth/controller/oauthregistration/default/PhabricatorOAuthDefaultRegistrationController.php +++ b/src/applications/auth/controller/oauthregistration/default/PhabricatorOAuthDefaultRegistrationController.php @@ -60,9 +60,9 @@ class PhabricatorOAuthDefaultRegistrationController } } - if ($user->getRealName() === null) { + if (!strlen($user->getRealName())) { $user->setRealName($request->getStr('realname')); - if (!strlen($user->getStr('realname'))) { + if (!strlen($user->getRealName())) { $e_realname = 'Required'; $errors[] = 'Real name is required.'; } else { diff --git a/src/applications/auth/oauth/provider/github/PhabricatorOAuthProviderGithub.php b/src/applications/auth/oauth/provider/github/PhabricatorOAuthProviderGithub.php index f5834369ae..f6e9759d19 100644 --- a/src/applications/auth/oauth/provider/github/PhabricatorOAuthProviderGithub.php +++ b/src/applications/auth/oauth/provider/github/PhabricatorOAuthProviderGithub.php @@ -78,7 +78,7 @@ class PhabricatorOAuthProviderGithub extends PhabricatorOAuthProvider { } public function retrieveUserEmail() { - return $this->userData['email']; + return idx($this->userData, 'email'); } public function retrieveUserAccountName() { @@ -103,7 +103,7 @@ class PhabricatorOAuthProviderGithub extends PhabricatorOAuthProvider { } public function retrieveUserRealName() { - return $this->userData['name']; + return idx($this->userData, 'name'); } } diff --git a/src/applications/auth/oauth/provider/github/__init__.php b/src/applications/auth/oauth/provider/github/__init__.php index b6e86d3f52..6c17b44365 100644 --- a/src/applications/auth/oauth/provider/github/__init__.php +++ b/src/applications/auth/oauth/provider/github/__init__.php @@ -9,5 +9,7 @@ phutil_require_module('phabricator', 'applications/auth/oauth/provider/base'); phutil_require_module('phabricator', 'infrastructure/env'); +phutil_require_module('phutil', 'utils'); + phutil_require_source('PhabricatorOAuthProviderGithub.php');