bug #9850 [Validator] Fixed IBAN validator with 0750447346 value (stewe)
This PR was merged into the 2.3 branch.
Discussion
----------
[Validator] Fixed IBAN validator with 0750447346 value
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
cf88ba5
[Validator] Fixed IBAN validator with 0750447346 value
This commit is contained in:
commit
c33341df09
@ -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) {
|
||||
|
@ -181,6 +181,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