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

Skip to content

[Validator] allow brackets in the optional query string #30606

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

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

eborges78
Copy link

@eborges78 eborges78 commented Mar 19, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #30603
License MIT
Doc PR symfony/symfony-docs#...

Add the allowBrackets option from the Url constraint to allow brackets in the optional query string.

@stof
Copy link
Member

stof commented Mar 19, 2019

The name allowExtraChars does not seem clear to me if it is actually about allowing brackets. When seeing it, I would have no idea what the extra chars are.

@eborges78 eborges78 closed this Mar 19, 2019
@eborges78 eborges78 reopened this Mar 19, 2019
@nicolas-grekas nicolas-grekas added this to the next milestone Mar 19, 2019
@fabpot
Copy link
Member

fabpot commented Mar 27, 2019

@eborges78 Can you rebase to get rid of the merge commit?

@eborges78 eborges78 force-pushed the feature/url branch 3 times, most recently from 2940c3d to 4fc4015 Compare March 27, 2019 07:47
@eborges78
Copy link
Author

@eborges78 Can you rebase to get rid of the merge commit?

Fixed.

@eborges78 eborges78 force-pushed the feature/url branch 3 times, most recently from 3bc4d1a to 5fe210c Compare March 27, 2019 07:52
@fabpot
Copy link
Member

fabpot commented Mar 27, 2019

Do we really need an option for that? Why would you not allow it?

@eborges78
Copy link
Author

Do we really need an option for that? Why would you not allow it?

I did not want to alter the existing behavior of the UrlValidator.
Do you think this option can be removed?

@fabpot
Copy link
Member

fabpot commented Mar 27, 2019

I would vote for having this by default with no options. WDYT @symfony/deciders?

@javiereguiluz
Copy link
Member

I agree with Fabien. According to RFC 3986 the following line is the regular expression for breaking-down a well-formed URI reference into its components:

^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

This is the query string part -> (\?([^#]*))? So nothing prevents using [ and ] and, therefore, we shouldn't treat them as a special thing.

@eborges78
Copy link
Author

@fabpot @javiereguiluz Thank you for your feedback. so I removed the option and allowed brackets by default

@fabpot
Copy link
Member

fabpot commented Mar 27, 2019

Thank you @eborges78.

@fabpot fabpot merged commit 40dc4c8 into symfony:master Mar 27, 2019
fabpot added a commit that referenced this pull request Mar 27, 2019
…g (Emmanuel BORGES)

This PR was squashed before being merged into the 4.3-dev branch (closes #30606).

Discussion
----------

[Validator] allow brackets in the optional query string

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30603
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Add the `allowBrackets` option from the Url constraint to allow brackets in the optional query string.

Commits
-------

40dc4c8 [Validator] allow brackets in the optional query string
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
@fabpot fabpot mentioned this pull request May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants