#10689 closed defect (fixed)
[cla][patch] creditCard validation error
Reported by: | nic | Owned by: | Karl Tiedt |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Dojox | Version: | 1.4.0 |
Keywords: | Cc: | nic | |
Blocked By: | Blocking: |
Description
isValidCreditCardNumber(value, ccType) returns true when a ccType is passed and value is too long
Attachments (1)
Change History (9)
Changed 11 years ago by
Attachment: | creditCard.js.diff added |
---|
comment:1 Changed 11 years ago by
comment:2 follow-up: 3 Changed 11 years ago by
Owner: | changed from Adam Peller to Karl Tiedt |
---|
Is the new RegExp?() necessary?
comment:3 follow-up: 4 Changed 11 years ago by
comment:4 Changed 11 years ago by
Replying to nic:
Replying to peller:
Is the new RegExp?() necessary?
It works using a string too, but IIRC the argument for match() must be a RegExp?
Just found on MDC: "A regular expression object. If a non-RegExp? object obj is passed, it is implicitly converted to a RegExp? by using new RegExp?(obj)." Can't find the docs on msdn :(
comment:5 Changed 11 years ago by
Status: | new → assigned |
---|
I would say there hasnt been any bug opened about the strings working as is, the correct fix should be to just append $ to the expr upon running the match...
(and yes this has been used in production since the time it was written as it was written for a live project (at least that was my understanding of the work done then) and contributed back to Dojo back in 2005 or 2006 so its definitely been put to a test in the real world)
I'll wait for any more comments and commit a patch minus the new RegExp? calls in a few days if there are no strong objections or new info that shows it does not work w/o the RegExp? calls
comment:7 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 Changed 11 years ago by
Milestone: | tbd → 1.5 |
---|
I'll add some test cases to tests/creditcard.js