[Validator] Fixed IBAN validator with 0750447346 value
This commit is contained in:
parent
50c39b946b
commit
cf88ba58a6
@ -30,6 +30,13 @@ class IbanValidator extends ConstraintValidator
|
||||
return;
|
||||
}
|
||||
|
||||
// An IBAN without a country code is not an IBAN.
|
||||
if (0 === preg_match('/[A-Za-z]/', $value)) {
|
||||
$this->context->addViolation($constraint->message, array('{{ value }}' => $value));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$teststring = preg_replace('/\s+/', '', $value);
|
||||
|
||||
if (strlen($teststring) < 4) {
|
||||
|
@ -182,6 +182,7 @@ class IbanValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
array('CY170020 128 0000 0012 0052 7600'),
|
||||
array('foo'),
|
||||
array('123'),
|
||||
array('0750447346')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user