From bcd83a6a948e0ca27d096d0a3e50aebe0de722f6 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Wed, 9 Jan 2019 16:20:35 +0530 Subject: [PATCH] issue with the regular expression used to determine the credit card type, PFW-341 --- angelleye-includes/angelleye-utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angelleye-includes/angelleye-utility.php b/angelleye-includes/angelleye-utility.php index 8414d7ded..bc7cabdce 100644 --- a/angelleye-includes/angelleye-utility.php +++ b/angelleye-includes/angelleye-utility.php @@ -951,8 +951,8 @@ public static function angelleye_paypal_credit_card_rest_setting_fields() { public static function card_type_from_account_number($account_number) { $types = array( 'visa' => '/^4[0-9]{0,15}$/i', - 'mastercard' => '/^5[1-5][0-9]{5,}|222[1-9][0-9]{3,}|22[3-9][0-9]{4,}|2[3-6][0-9]{5,}|27[01][0-9]{4,}|2720[0-9]{3,}$/i', - 'amex' => '/^3$|^3[47][0-9]{0,13}$/i', + 'mastercard' => '/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/i', + 'amex' => '/^3[47][0-9]{13}$/i', 'discover' => '/^6$|^6[05]$|^601[1]?$|^65[0-9][0-9]?$|^6(?:011|5[0-9]{2})[0-9]{0,12}$/i', 'diners' => '/^3(?:0[0-5]|[68][0-9])[0-9]{4,}$/i', 'jcb' => '/^(?:2131|1800|35[0-9]{3})[0-9]{3,}$/i',