8000 UrlValidator component fails with one-char subdomain · Issue #43038 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
UrlValidator component fails with one-char subdomain #43038
Closed
@MimoBerlino

Description

@MimoBerlino

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

      0