8000 protocolless urls not valid according to the UrlValidator · Issue #24287 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

protocolless urls not valid according to the UrlValidator #24287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carakas opened this issue Sep 22, 2017 · 1 comment
Closed

protocolless urls not valid according to the UrlValidator #24287

carakas opened this issue Sep 22, 2017 · 1 comment

Comments

@carakas
Copy link
carakas commented Sep 22, 2017
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 3.3.6

The Symfony\Component\Validator\Constraints\UrlValidator regex fails when not passing the protocol.

  • http://test.com/index.js => passes
  • https://test.com/index.js => passes
  • //test.dev/index.js => fails

//test.dev/index.js works perfectly in the browser but doesn't pass the validator

@nicolas-grekas
Copy link
Member

moving a feature request

@javiereguiluz javiereguiluz added this to the 4.1 milestone Dec 26, 2017
nicolas-grekas added a commit that referenced this issue Feb 14, 2018
…gitalLife)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[Validator] support protocolless urls validation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24287
| License       | MIT

As specified in issue #24287 URL's starting with no protocol but with just `//` are valid URL's and should be accepted by the validator. This pull request fixes the regex used to validate URL's.

Commits
-------

d845406 [Validator] support protocolless urls validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0