Skip to content

discover card validation regex incorrect #1138

Closed
lilliangel opened this Issue Jul 25, 2012 · 1 comment

2 participants

@lilliangel

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
MooTools member
@arian arian closed this in #1272 Jun 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.