Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Improve regexp for Credit Cards and some more tests#6583

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 2 commits intosymfony:masterfromricardclau:improve-creditcard-regexp
Jan 7, 2013
Merged

[Validator] Improve regexp for Credit Cards and some more tests#6583

fabpot merged 2 commits intosymfony:masterfromricardclau:improve-creditcard-regexp
Jan 7, 2013

Conversation

ricardclau
Copy link
Contributor

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: Ensure these regexps are proper (credit card validation is always a pain)
License of the code: MIT
Documentation PR:

Regarding Cases excluded from new Regular Expressions:

  • Credit card lengths should be respected, these regexp cover lengths inhttp://en.wikipedia.org/wiki/Bank_card_number
  • Visa length can only be 16 and 13 (older ones)
  • Diners Cards starting by 5 come from a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard (according tohttp://www.regular-expressions.info/creditcard.html).
  • There seems to be JCB cards starting by 2131 and 1800, I could find them is some places, also found these numbers being tested in Credit Card generators, but some people don't cover them. I don't know their story either

Any comments will be much appreciated!

@fabpot
Copy link
Member

Thanks for working on this. It would be very valuable if you can add information about these regexes as comments (with links to relevant sources -- like what you've done in the PR description). Thanks.

@ricardclau
Copy link
ContributorAuthor

Always glad to be able to contribute a little bit

@fabpot you mean@link /@see PHPDoc inside CardSchemeValidator.php? Or further comments in this discussion before adding them?

@fabpot
Copy link
Member

The more information we can add in the class, the better it is.

@ricardclau
Copy link
ContributorAuthor

I've added comments and included code from#6603 as I've said there. If you need something else, please let me know, once this is merged,#6603 can also be closed

@fabpot
Copy link
Member

Can you keep the commit from#6603 to keep ownership?

@ricardclau
Copy link
ContributorAuthor

I actually have thought about that... let me try my git skills :)

@ricardclau
Copy link
ContributorAuthor

There you go!

fabpot added a commit that referenced this pull requestJan 7, 2013
This PR was merged into the master branch.Commits-------5be0042 better regexp, more test cases, added comments about each credit cardcc278af [Validator] Fix `CardSchemeValidator` double violation when value is non-numeric. Making scheme option accept strings in addition to arrays.Discussion----------[Validator] Improve regexp for Credit Cards and some more testsBug fix: yesFeature addition: noBackwards compatibility break: noSymfony2 tests pass: yesFixes the following tickets:Todo: Ensure these regexps are proper (credit card validation is always a pain)License of the code: MITDocumentation PR:Regarding Cases excluded from new Regular Expressions:- Credit card lengths should be respected, these regexp cover lengths inhttp://en.wikipedia.org/wiki/Bank_card_number- Visa length can only be 16 and 13 (older ones)- Diners Cards starting by 5 come from a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard (according tohttp://www.regular-expressions.info/creditcard.html).- There seems to be JCB cards starting by 2131 and 1800, I could find them is some places, also found these numbers being tested in Credit Card generators, but some people don't cover them. I don't know their story eitherAny comments will be much appreciated!---------------------------------------------------------------------------by fabpot at 2013-01-06T19:33:27ZThanks for working on this. It would be very valuable if you can add information about these regexes as comments (with links to relevant sources -- like what you've done in the PR description). Thanks.---------------------------------------------------------------------------by ricardclau at 2013-01-06T21:01:52ZAlways glad to be able to contribute a little bit@fabpot you mean@link /@see PHPDoc inside CardSchemeValidator.php? Or further comments in this discussion before adding them?---------------------------------------------------------------------------by fabpot at 2013-01-06T21:16:48ZThe more information we can add in the class, the better it is.---------------------------------------------------------------------------by ricardclau at 2013-01-07T20:56:05ZI've added comments and included code from#6603 as I've said there. If you need something else, please let me know, once this is merged,#6603 can also be closed---------------------------------------------------------------------------by fabpot at 2013-01-07T21:41:40ZCan you keep the commit from#6603 to keep ownership?---------------------------------------------------------------------------by ricardclau at 2013-01-07T21:44:16ZI actually have thought about that... let me try my git skills :)---------------------------------------------------------------------------by ricardclau at 2013-01-07T21:59:16ZThere you go!
@fabpotfabpot merged commit5be0042 intosymfony:masterJan 7, 2013
@ricardclauricardclau deleted the improve-creditcard-regexp branchJanuary 7, 2013 22:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ricardclau@fabpot@Sgoettschkes

[8]ページ先頭

©2009-2025 Movatter.jp