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

UrlValidator component fails with one-char subdomain #43038

Copy link
Copy link
Closed
@MimoBerlino

Description

@MimoBerlino
Issue body actions

Symfony version(s) affected: 4.4.30

Description
The UrlValidator is failing when the url contains multiple subdomains, and when one of the subdomains is a one-char subdomain. Example: "http://subdom1.subdom2.r.suddom3.domain.tld"
The "r" subdomain here makes the validator fail.
Please note that it only happens when the one-char subdomain is positioned between other subdomains.

How to reproduce

/**
     * @Assert\NotBlank
     * @Assert\Url(protocols = {"https"})
     * @ORM\Column(type="string", length=255)
     */

Possible Solution
Review the regex modified 2 weeks ago to allow one-char subdomain.

Additional context
I could see the regex validator was modified around 2 weeks ago, that introduced this failure.
Here is the commit: 074539d

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.