Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Use rawurlencode() to transform the Cookie into a string#23461
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
javiereguiluz commentedJul 9, 2017
| Q | A |
|---|---|
| Branch? | 2.7 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #23255 |
| License | MIT |
| Doc PR | - |
nicolas-grekas commentedJul 10, 2017
Cookie in BrowserKit has the same issue isn't it? |
javiereguiluz commentedJul 10, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas I've made that change too. However, when copying the Examples: $cookie =newCookie('foo','bar',strtotime('Fri, 20-May-2011 15:25:52 GMT'),'/','.myfoodomain.com',true);// in HttpFoundation(string)$cookie ='foo=bar; expires=Fri, 20 May 2011 15:25:52 GMT; domain=.myfoodomain.com; path=/; secure; httponly'// in BrowserKit(string)$cookie ='foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly' $cookie =newCookie('foo','bar',0,'/','');// in HttpFoundation(string)$cookie ='foo=bar; path=/; httponly'// in BrowserKit(string)$cookie ='foo=bar; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; httponly' |
| { | ||
| if ($encodedValue) { | ||
| $this->value =urldecode($value); | ||
| $this->value =rawurldecode($value); |
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.
if we update decoding,Cookie::fromString in HttpFoundation should probably be updated as well, note howeverurldecode works forrawurlencode perfectly fine, so im not sure we should change it (givenrawurldecode doesnt work forurlencode).
nicolas-grekasJul 10, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
works for me, we can keepurldecode here
stof commentedJul 10, 2017
@javiereguiluz your first example outputs the same cookie. Attributes are just given in a different order. But order is not meaningful. |
javiereguiluz commentedJul 10, 2017
@stof yes, the first example is the same, but with a different ordering. But I think it should be exactly the same. The attention a project pays to details like this says a lot about a project 😄 |
nicolas-grekas commentedJul 11, 2017
Thank you@javiereguiluz. |
…javiereguiluz)This PR was squashed before being merged into the 2.7 branch (closes#23461).Discussion----------Use rawurlencode() to transform the Cookie into a string| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#23255| License | MIT| Doc PR | -Commits-------025dfff Use rawurlencode() to transform the Cookie into a string