Skip to content

Commit 3f7e4b6

Browse files
Merge branch '2.7' into 2.8
* 2.7: fixed wrong description in a phpdoc 19 digits VISA card numbers are valid [HttpKernel] Fixed test name [Debug] prevent infinite loop with faulty exception handlers Add the missing `enabled` session attribute [HttpKernel] Turn bad hosts into 400 instead of 500
2 parents e6da867 + 7e320ab commit 3f7e4b6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Constraints/CardSchemeValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class CardSchemeValidator extends ConstraintValidator
7979
'/^5[1-5][0-9]{14}$/',
8080
'/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/',
8181
),
82-
// All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.
82+
// All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits.
8383
'VISA' => array(
84-
'/^4([0-9]{12}|[0-9]{15})$/',
84+
'/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/',
8585
),
8686
);
8787

Tests/Constraints/CardSchemeValidatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function getValidNumbers()
111111
array('VISA', '4111111111111111'),
112112
array('VISA', '4012888888881881'),
113113
array('VISA', '4222222222222'),
114+
array('VISA', '4917610000000000003'),
114115
array(array('AMEX', 'VISA'), '4111111111111111'),
115116
array(array('AMEX', 'VISA'), '378282246310005'),
116117
array(array('JCB', 'MASTERCARD'), '5105105105105100'),

0 commit comments

Comments
 (0)