Consider all domain suffixes for blacklisting and normalise implementations #54
Conversation
- Use the (better) regex from the Ruby code for checking for well-formed email addresses, - Check for matches using identity equality (is/is not None), - Use stdlib unittest module for tests and import testcases from Ruby
- Add instructions to run tests - Ensure minitest is a development dependency - Add tests for blank emails
- Use PHPUnit test framework (via composer dependency) - Add instructions to run tests
- Multiple expectations per test - Add blank/empty invalid email tests
- Use the same valid email regexp everywhere - based on PHP's FILTER_VALIDATE_EMAIL, - Lowercase the list entries in the generator, rather than in each match implementation.
I can't work out why circle ci is failing on
|
FGRibreau
added a commit
that referenced
this pull request
Mar 18, 2016
Consider all domain suffixes for blacklisting and normalise implementations
Very impressive work @owst!! Thanks a lot! |
You're welcome, thanks for maintaining the project! How do we go about getting a new Ruby gem published? At work we're currently overriding By the way, do you have any idea why |
Hello @owst , It's now fixed, I pushed ruby-mailchecker-1.6.3.gem :) |
Great, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This change was triggered by the Ruby implementation not matching any blacklisted domains with more than 1 subdomain, e.g.
test@spamthis.co.uk
would not be considered invalid, even thoughspamthis.co.uk
is a blacklisted domain.This refactoring normalises the implementation across the 7 languages:
This removes false-negatives (e.g. where the domain includes > 2 subdomains) in some cases, and false-positives (e.g. where a blacklisted domain appears as a subdomain) in other cases.
As a side effect, several improvements were made to the tests of PHP, Python in particular, using standard libraries for unit testing rather than ad-hoc tests.
Meta: I think this will be easiest to review on a commit-by-commit basis. This PR is based off my other pending PR, so that PR's commit also shows up here.