Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Allow basic auth in url when using UrlValidator.#11601
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
.+? is equivalent to.*
and anyway, this pattern is wrong. is too permissive here. For instance, you cannot have a@ in there (you have to urlencode it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@stof Is this better([\pL\pN-]*):([\pL\pN-]*)@ ?
I'm not an expert in regex, but i need this to be fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should be(([\pL\pN-]+:)?([\pL\pN-]+)@)? then, as the first part is optional and at least the second should exists with the@ sign.
OK:user:pass@,user@ and empty.
WRONG:user:pass,@,:pass@,:pass
Hmm seems regex is failing need to take a look at this.
Ah never mind I forgot to click for the test 😳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thx@sstok for your help
Improve regex. Add tests.
blaugueux commentedAug 8, 2014
@stof do i need to fix something else ? |
stof commentedAug 8, 2014
👍 |
fabpot commentedAug 9, 2014
👍 |
fabpot commentedAug 9, 2014
Thank you@blaugueux. |
…r. (blaugueux)This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes#11601).Discussion----------[Validator] Allow basic auth in url when using UrlValidator.| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Now an url with basic auth like ```http://username:password@symfony.com``` can be valid.Commits-------f1ea987 Allow basic auth in url. Improve regex. Add tests.
blaugueux commentedAug 9, 2014
Huge thanks for all your work@fabpot |
Now an url with basic auth like
http://username:password@symfony.comcan be valid.