9ed8d576e1
This PR was squashed before being merged into the 2.7 branch (closes #20102).
Discussion
----------
[Validator] Url validator not validating hosts ending in a number
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (Should validate slightly more urls)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | None that I could find
| License | MIT
| Doc PR |
We ran into an issue where the URL validator wasn't validating URL that we got from a legitimate (intranet) URL. Afaict from skimming RFCs the URL `http://myhost123/` is valid, however the current regular expression doesn't accept the last part of a hostname (in this case the entire hostname is the last part as there are no periods in the host).
I've fixed this by adding the numbers unicode character property to the regular expression, I'm not sure but symbol characters (`\pS`) might need to be added to the group as well.
Commits
-------
|
||
---|---|---|
.. | ||
Constraints | ||
Context | ||
Exception | ||
Mapping | ||
Resources/translations | ||
Tests | ||
Util | ||
Validator | ||
Violation | ||
.gitignore | ||
CHANGELOG.md | ||
ClassBasedInterface.php | ||
composer.json | ||
Constraint.php | ||
ConstraintValidator.php | ||
ConstraintValidatorFactory.php | ||
ConstraintValidatorFactoryInterface.php | ||
ConstraintValidatorInterface.php | ||
ConstraintViolation.php | ||
ConstraintViolationInterface.php | ||
ConstraintViolationList.php | ||
ConstraintViolationListInterface.php | ||
DefaultTranslator.php | ||
ExecutionContext.php | ||
ExecutionContextInterface.php | ||
GlobalExecutionContextInterface.php | ||
GroupSequenceProviderInterface.php | ||
LICENSE | ||
MetadataFactoryInterface.php | ||
MetadataInterface.php | ||
ObjectInitializerInterface.php | ||
phpunit.xml.dist | ||
PropertyMetadataContainerInterface.php | ||
PropertyMetadataInterface.php | ||
README.md | ||
Validation.php | ||
ValidationVisitor.php | ||
ValidationVisitorInterface.php | ||
Validator.php | ||
ValidatorBuilder.php | ||
ValidatorBuilderInterface.php | ||
ValidatorInterface.php |
Validator Component
The Validator component provides tools to validate values following the JSR-303 Bean Validation specification.