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

discover card validation regex incorrect #1138

Closed
langel-tc opened this issue Jul 25, 2012 · 1 comment · Fixed by #1272
Closed

discover card validation regex incorrect #1138

langel-tc opened this issue Jul 25, 2012 · 1 comment · Fixed by #1272

Comments

@langel-tc
Copy link

mootools-more-1.4.0.1.js
@@ -4965,7 +4965,7 @@

    Form.Validator.addAllThese([
            if (ccNum.test(/^4[0-9]{12}([0-9]{3})?$/)) valid_type = 'Visa';
            else if (ccNum.test(/^5[1-5]([0-9]{14})$/)) valid_type = 'Master Card';
            else if (ccNum.test(/^3[47][0-9]{13}$/)) valid_type = 'American Express';
-           else if (ccNum.test(/^6011[0-9]{12}$/)) valid_type = 'Discover';
+           else if (ccNum.test(/^6(?:011|5[0-9]{2})[0-9]{12}$/)) valid_type = 'Discover';

            if (valid_type){
                var sum = 0;
@fakedarren
Copy link
Member

@anutron?

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 a pull request may close this issue.

2 participants