Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#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)

creditCard.js.diff (641 bytes) - added by nic 10 years ago.

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by nic

Attachment: creditCard.js.diff added

comment:1 Changed 10 years ago by nic

I'll add some test cases to tests/creditcard.js

comment:2 Changed 10 years ago by Adam Peller

Owner: changed from Adam Peller to Karl Tiedt

Is the new RegExp?() necessary?

comment:3 in reply to:  2 ; Changed 10 years ago by 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?

comment:4 in reply to:  3 Changed 10 years ago by nic

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 10 years ago by Karl Tiedt

Status: newassigned

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:6 Changed 9 years ago by Adam Peller

bump

comment:7 Changed 9 years ago by Karl Tiedt

Resolution: fixed
Status: assignedclosed

(In [21885]) fixes #10689

comment:8 Changed 9 years ago by bill

Milestone: tbd1.5
Note: See TracTickets for help on using tickets.