Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.0
Component:
Payment
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2011 at 12:14 UTC
Updated:
2 Dec 2011 at 16:40 UTC
Hey no big deal here but if $exp_month is 0 or >12, there is no validation preventing this from passing.
Reference commerce_payment_credit_card_validate() i
Comments
Comment #1
rszrama commentedI don't really think it matters, since the Forms API is already validating CC input against allowed options from the form. I suppose someone could create their own CC form using textfields instead of select lists and then use these validation functions... but I doubt it would happen. : P
But in the interest of making them flexible, why not. I've added month validation so the start date and expiration date validation functions can be used to validate data that comes from other sources than the normal CC form. It will fail for the month if a value less than 1 or greater than 12 is given.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/ff39e56
Comment #2
rszrama commentedI don't really think it matters, since the Forms API is already validating CC input against allowed options from the form. I suppose someone could create their own CC form using textfields instead of select lists and then use these validation functions... but I doubt it would happen. : P
But in the interest of making them flexible, why not. I've added month validation so the start date and expiration date validation functions can be used to validate data that comes from other sources than the normal CC form. It will fail for the month if a value less than 1 or greater than 12 is given.
Commit: http://drupalcode.org/project/commerce.git/commitdiff/ff39e56
Comment #3
blasthaus commentedThanks as I said no biggie, I was indeed using just the validation functions for a credit card billing-update form which was initially built as a text inputs and just happened to noticed that. The validations are awesome btw, great work as always!
Comment #4
rszrama commentedRockin'. It wasn't hard to put it in. ; )