Closed
Description
Symfony version(s) affected: 4.3.2 (propably earlier versions too)
Description
Url validator returns false (invalid url) on valid, and existing url - pattern issue
How to reproduce
Simply get an validator instance, and validate string/model with Url validator.
Url must contain underscores _
(im amazed to see them in url tho)
$url = 'http://www.cku_zsr_glubczyce.wodip.opole.pl';
$violations = $this->validator->validate(['url' => $url], [
new Collection([
'fields' => [
'url' => [new Url()]
]
])
]);
if ($violations->count() > 0) {
/** @var ConstraintViolation $violation */
foreach ($violations as $violation) {
echo $violation->getPropertyPath() . ' :: ' . $violation->getMessage() . "\n";
}
Possible Solution
Update pattern in validator :)
Additional context