I just noticed that commerce_payment_validate_credit_card_exp_date('1', 'blah') will return TRUE.

The other functions inside of commerce_payment_credit_card_validate() handle numbers initially like so:

<?php
  // Ensure every character in the number is numeric.
  if (!ctype_digit($number)) {
    return FALSE;
  }
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blasthaus created an issue. See original summary.

swim’s picture

Status: Active » Needs review
FileSize
541 bytes

Tested and can confirm the bug exists. Patch attached.

swim’s picture

FileSize
798 bytes

Sorry, should have applied to both validation function, start date and exp date.