Skip to content

Conversation

@dawehner
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets #12200
License MIT
Doc PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unencoding the = is not safe. There is a difference between ?foo%3Dbar=baz and ?foo=bar=baz!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One means array('foo=bar' => 'baz') and the other array('foo' => 'bar=baz')

@dawehner
Copy link
Contributor Author

You are absolute right, let's imit it to the two special cases described in the RFC

@fabpot
Copy link
Member

fabpot commented Oct 14, 2014

@Tobion Is it good now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree that decoding ? makes things better. For example: /path/sub?foo?bar it gets very hard to see where the query part starts. I think other chars are more worth to keep decoded like @, e.g. when you pass an email like [email protected]. So I think its ok to use $this->decodedChars BUT without = and & (in case somebody added it in a subclass). Just unset them in a local variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the documentation of $this->decodedChars should be updated then to mention its also used for query decoding.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn + is probably risky as well. Since it is the encoded form of space when using forms.
So ?foo=bar+baz will result in _GET["foo"] = 'bar baz' which is bad.

So I guess we should just decode the / for now.

@dawehner
Copy link
Contributor Author

Okay, let's just do the "/" for now.

@fabpot
Copy link
Member

fabpot commented Oct 27, 2014

Thank you @dawehner.

@fabpot fabpot merged commit cd2c2e3 into symfony:master Oct 27, 2014
fabpot added a commit that referenced this pull request Oct 27, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

decodes some special chars in a URL query

| Q             | A
| ------------- | ---
| Bug fix?      | yes|no (not sure :) )
| New feature?  | no
| BC breaks?    | yes|no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12200
| License       | MIT
| Doc PR        |

Commits
-------

cd2c2e3 decodes some special chars in a URL query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants