Put a very rough filter on what we'll accept as an email address. We can expand this if anyone is actually using local delivery or other weird things. This is mostly to avoid a theoretical case where some input is parsed differently by PhutilAddressParser and the actual mail adapter, in some subtle hypothetical way. This should give us only "reasonable" email addresses which parsers would be hard-pressed to trip up on.
Details
Details
- Reviewers
arice btrahan - Commits
- Restricted Diffusion Commit
rPf49470f9bf91: Add rough validation on email addresses
Added and executed unit tests. Tried to add silly emails. Added valid emails.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
A masterpiece.
src/applications/people/storage/PhabricatorUserEmail.php | ||
---|---|---|
52 | In the local portion, there are a number of special characters that are technically permissible, but relatively uncommon. It probably wouldn't hurt to whitelist the whole range, but the only missing character in common usage is ! "atext", here: http://tools.ietf.org/html/rfc5322#section-3.2.3 | |
src/applications/people/storage/__tests__/PhabricatorUserEmailTestCase.php | ||
23 | Would add failure cases for the common delimiters (, ;) as well as repeat @
|