egulias / EmailValidator

PHP Email address validator
MIT License
11.45k stars 210 forks source link

ASCII-only RFC Validation #300

Open tyteen4a03 opened 3 years ago

tyteen4a03 commented 3 years ago

Is it possible to only enable ASCII in RFC validation?

egulias commented 3 years ago

Hello @tyteen4a03 , you can create one and I would be more than happy to review and merge. You can do so by creating:

  1. Create a comprehensive suite of tests where non-ascii should fail
  2. A new ASCIILocalPart parser extending from https://github.com/egulias/EmailValidator/blob/3.x/src/Parser/PartParser.php
  3. A new ASCIIParser by implementing https://github.com/egulias/EmailValidator/blob/3.x/src/Parser.php and reusing the DomainPartParser
  4. A new ASCIIValidator implementing the https://github.com/egulias/EmailValidator/blob/3.x/src/Validation/EmailValidation.php interface and using ASCIIParser you just created.
  5. Send a PR :)