Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix url validator to accept underscore in sub-domain name #10467

Closed
@adicosoi

Description

@adicosoi

Url validator accept as valid an url like the following:
http://testsub+domanin.domanin.com:8080/test

but does not accept
http://test_sub_domanin.domanin.com:8080/test

The problem seems to be here:
symfony / src / Symfony / Component / Validator / Constraints / UrlValidator.php
Line 28: ([\pL\pN\pS-]+.)+[\pL]+ # a domain name

The fix can be as simple as replacing \pS (mathematical symbol) with \pP (punctuation character) or even better i think \pPc (Connector Punctuation character)

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