@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix GitHub OAuth Registration for users without a name

Summary:
Github allows you to have an account without a real name. The OAuth controller
actually handles this fine, mostly, except that it calls a bogus method. Also
there is some null vs empty string confusion.

Test Plan:
Deleted my name on Github and then registered for an account on Phabricator.

Reviewed By: tuomaspelkonen
Reviewers: jungejason, tuomaspelkonen, aran
CC: anjali, aran, tuomaspelkonen
Differential Revision: 247

+6 -4
+2 -2
src/applications/auth/controller/oauthregistration/default/PhabricatorOAuthDefaultRegistrationController.php
··· 60 60 } 61 61 } 62 62 63 - if ($user->getRealName() === null) { 63 + if (!strlen($user->getRealName())) { 64 64 $user->setRealName($request->getStr('realname')); 65 - if (!strlen($user->getStr('realname'))) { 65 + if (!strlen($user->getRealName())) { 66 66 $e_realname = 'Required'; 67 67 $errors[] = 'Real name is required.'; 68 68 } else {
+2 -2
src/applications/auth/oauth/provider/github/PhabricatorOAuthProviderGithub.php
··· 78 78 } 79 79 80 80 public function retrieveUserEmail() { 81 - return $this->userData['email']; 81 + return idx($this->userData, 'email'); 82 82 } 83 83 84 84 public function retrieveUserAccountName() { ··· 103 103 } 104 104 105 105 public function retrieveUserRealName() { 106 - return $this->userData['name']; 106 + return idx($this->userData, 'name'); 107 107 } 108 108 109 109 }
+2
src/applications/auth/oauth/provider/github/__init__.php
··· 9 9 phutil_require_module('phabricator', 'applications/auth/oauth/provider/base'); 10 10 phutil_require_module('phabricator', 'infrastructure/env'); 11 11 12 + phutil_require_module('phutil', 'utils'); 13 + 12 14 13 15 phutil_require_source('PhabricatorOAuthProviderGithub.php');