Merge branch 'backport-8741-8690' into 2.x

This commit is contained in:
Philippe Saint-Just 2016-04-30 13:11:34 -04:00
parent 0934d02f0e
commit cd07850337
3 changed files with 8 additions and 2 deletions

View file

@ -132,7 +132,7 @@ class FileEngine extends CacheEngine {
}
$expires = time() + $duration;
$contents = $expires . $lineBreak . $data . $lineBreak;
$contents = implode([$expires, $lineBreak, $data, $lineBreak]);
if ($this->settings['lock']) {
$this->_File->flock(LOCK_EX);

View file

@ -403,6 +403,12 @@ class ValidationTest extends CakeTestCase {
$this->assertTrue(Validation::cc('5467639122779531', array('mc')));
$this->assertTrue(Validation::cc('5297350261550024', array('mc')));
$this->assertTrue(Validation::cc('5162739131368058', array('mc')));
//Mastercard (additional 2016 BIN)
$this->assertTrue(Validation::cc('2221000000000009', array('mc')));
$this->assertTrue(Validation::cc('2720999999999996', array('mc')));
$this->assertTrue(Validation::cc('2223000010005798', array('mc')));
$this->assertTrue(Validation::cc('2623430710235708', array('mc')));
$this->assertTrue(Validation::cc('2420452519835723', array('mc')));
//Solo 16
$this->assertTrue(Validation::cc('6767432107064987', array('solo')));
$this->assertTrue(Validation::cc('6334667758225411', array('solo')));

View file

@ -182,7 +182,7 @@ class Validation {
'enroute' => '/^2(?:014|149)\\d{11}$/',
'jcb' => '/^(3\\d{4}|2100|1800)\\d{11}$/',
'maestro' => '/^(?:5020|6\\d{3})\\d{12}$/',
'mc' => '/^5[1-5]\\d{14}$/',
'mc' => '/^(5[1-5]\\d{14})|(2(?:22[1-9]|2[3-9][0-9]|[3-6][0-9]{2}|7[0-1][0-9]|720)\\d{12})$/',
'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
'switch' =>
'/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',