minor #19147 [Validator] explicitly forbid e-mail validator 2.0 or higher (xabbuh)
This PR was merged into the 2.7 branch.
Discussion
----------
[Validator] explicitly forbid e-mail validator 2.0 or higher
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
81a6d8e
explicitly forbid e-mail validator 2.0 or higher
This commit is contained in:
commit
989f821703
@ -56,8 +56,8 @@ class EmailValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($constraint->strict) {
|
if ($constraint->strict) {
|
||||||
if (!class_exists('\Egulias\EmailValidator\EmailValidator')) {
|
if (!class_exists('\Egulias\EmailValidator\EmailValidator') || interface_exists('\Egulias\EmailValidator\Validation\EmailValidation')) {
|
||||||
throw new RuntimeException('Strict email validation requires egulias/email-validator');
|
throw new RuntimeException('Strict email validation requires egulias/email-validator:~1.2');
|
||||||
}
|
}
|
||||||
|
|
||||||
$strictValidator = new \Egulias\EmailValidator\EmailValidator();
|
$strictValidator = new \Egulias\EmailValidator\EmailValidator();
|
||||||
|
Reference in New Issue
Block a user