Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix credit card validator #670

Merged
merged 4 commits into from
Jun 22, 2017

Conversation

michaltk
Copy link
Contributor

Validator seems to have been allowing invalid credit cards through.
Issue seems to have started after #539.
The regex for cards starting with 62 was added to the wrong place, causing regular cards to be allowed to have extra trailing numbers and cards starting with 62 to have extra leading numbers.

You can see a visualization of the regex before and after this change here:
before: http://tinyurl.com/yaotlrhv
after: http://tinyurl.com/y7xx5vpr

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.129% when pulling 718321f on michaltk:fix-creditcard-validator into fb2ae42 on chriso:master.

@chriso
Copy link
Collaborator

chriso commented Jun 22, 2017

Thanks.

@chriso chriso merged commit 9a1e691 into validatorjs:master Jun 22, 2017
chriso added a commit that referenced this pull request Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants