Opened 10 years ago

Closed 10 years ago

#14863 closed defect (invalid)

Method isValidCreditCardNumber does not work correct

Reported by: lexus Owned by: Karl Tiedt
Priority: undecided Milestone: tbd
Component: Dojox Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


Steps to reproduce: Call dojox.validate.isValidCreditCardNumber("a4111111111111", "VI");

Actual result: true

Expected result: false

Description: According to source code problem IMHO in the line:

return Boolean(_b3.match(_b6[_b4.toLowerCase()]));

Possible solution: it should be something like this:

return Boolean(_b3.match("^" + _b6[_b4.toLowerCase()] + "$"));

Change History (3)

comment:1 Changed 10 years ago by Adam Peller

Owner: changed from Adam Peller to Karl Tiedt
Status: newassigned

Karl, can you take a look?

comment:2 Changed 10 years ago by Karl Tiedt

In [27967]:

added test case for impure CreditCard? numbers refs #14863

comment:3 Changed 10 years ago by Karl Tiedt

Resolution: invalid
Status: assignedclosed

All creditCard regex's are wrapped by

^ and $

already... so not sure what version you are testing against, but this is definitely working already

Actually the referenced code was fixed in 2010 [21885]

Last edited 10 years ago by Karl Tiedt (previous) (diff)
Note: See TracTickets for help on using tickets.