@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 two registration errors for unusual provider emails

Summary:
See <https://github.com/facebook/phabricator/issues/541>.

- If a provider returns the email `""` or `"0"`, we currently don't let the user edit it and thus don't let them register.
- If a provider returns an invalid email like `"!!!"` (permitted by GitHub, e.g.), we show them a nonsense error message.

Instead:

- Pretend we didn't get an address if we get an invalid address.
- Test the address strictly against `null`.

Test Plan: Registered on Phabricator with my GitHub email set to `""` (empty string) and `"!!!"` (bang bang bang).

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: aran, epriestley

Differential Revision: https://secure.phabricator.com/D8528

+7 -2
+7 -2
src/applications/auth/controller/PhabricatorAuthRegisterController.php
··· 57 57 58 58 $default_username = $account->getUsername(); 59 59 $default_realname = $account->getRealName(); 60 + 60 61 $default_email = $account->getEmail(); 61 - if ($default_email) { 62 + if (!PhabricatorUserEmail::isValidAddress($default_email)) { 63 + $default_email = null; 64 + } 65 + 66 + if ($default_email !== null) { 62 67 // If the account source provided an email, but it's not allowed by 63 68 // the configuration, roadblock the user. Previously, we let the user 64 69 // pick a valid email address instead, but this does not align well with ··· 84 89 // TODO: See T3340. 85 90 // TODO: See T3472. 86 91 87 - if ($default_email) { 92 + if ($default_email !== null) { 88 93 $same_email = id(new PhabricatorUserEmail())->loadOneWhere( 89 94 'address = %s', 90 95 $default_email);