Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix $browser: change to encodeURIComponent and decodeURIComponent for co... #8125

Closed
wants to merge 2 commits into from

Conversation

andrewtarry
Copy link

Request Type: bug

How to reproduce: Include special characters (€) in a cookie and it will not decode correctly.

Component(s): ngCookies

Impact: small

Complexity: small

This issue is related to:

Detailed Description:

Other Comments:

the self.cookies method in $browser was using escape and unescape to handle the cookie name and value. These methods are deprecated and cause problems with some special characters (€). The method has been changed to use the replacement encodeURIComponent and decodeURIComponent.

… cookie reading

the self.cookies method in $browser was using escape and unescape to handle the cookie name and value. These methods are deprecated and cause problems with some special characters (€). The method has been changed to use the replacement encodeURIComponent and decodeURIComponent.
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#8125)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@@ -280,16 +280,16 @@ function Browser(window, document, $log, $sniffer) {
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
/* global escape: false, unescape: false */
/* global encodeURIComponent: false, decodeURIComponent: false */
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor $browser: 

Removed the jshint globals that are not needed
@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@IgorMinar
Copy link
Contributor

I think that there was a reason why we used escape. if the reason is still valid then we should have a test for it but that doesn't seem to be the case.

we should take a close look before merging this in

@Narretz Narretz modified the milestones: Backlog, Purgatory Jul 15, 2014
@IgorMinar
Copy link
Contributor

I looked into the git history and there is no indicator that escape is required here. It looks like we've been using it since forever.

So this PR looks good to me.

@IgorMinar
Copy link
Contributor

@andrewtarry I can't find your CLA signature. Have you signed it already?

IgorMinar pushed a commit to IgorMinar/angular.js that referenced this pull request Jul 16, 2014
… cookie reading

the self.cookies method in $browser was using escape and unescape to handle the cookie name and value. These methods are deprecated and cause problems with some special characters (€). The method has been changed to use the replacement encodeURIComponent and decodeURIComponent.

Closes angular#8125
@IgorMinar IgorMinar self-assigned this Jul 16, 2014
@IgorMinar IgorMinar modified the milestones: 1.3.0-beta.16, Purgatory Jul 16, 2014
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this pull request Jul 16, 2014
…eading

the self.cookies method in $browser was using escape and unescape to handle the cookie name and value. These methods are deprecated and cause problems with some special characters (€). The method has been changed to use the replacement encodeURIComponent and decodeURIComponent.

Closes angular#8125
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this pull request Jul 16, 2014
…eading

the self.cookies method in $browser was using escape and unescape to handle the cookie name and value. These methods are deprecated and cause problems with some special characters (€). The method has been changed to use the replacement encodeURIComponent and decodeURIComponent.

Closes angular#8125
@andrewtarry
Copy link
Author

I have signed it online but it was only recent so it might not have been processed yet.

@IgorMinar
Copy link
Contributor

CLA verified manually. But can you please sign the CLA one more time with the email address you used in your commits (see https://github.com/angular/angular.js/pull/8125.patch)

@IgorMinar
Copy link
Contributor

otherwise you'll be bugged by the CLA robot in the future again

@IgorMinar IgorMinar closed this in 1c9ab40 Jul 16, 2014
@andrewtarry
Copy link
Author

I've resigned it. It was done from the office so had the wrong email.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants