Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Url validator] Returns false for valid (and existing) url #32506

Copy link
Copy link
Closed
@kptLucek

Description

@kptLucek
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.