-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix $browser: change to encodeURIComponent and decodeURIComponent for co... #8125
Conversation
… 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.
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with 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 */ |
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.
we don't need to put these in global
, they're there by default (https://github.com/jshint/jshint/blob/681b406918e96044be3375e389ddbe931740a804/src/jshint.js#L4630)
refactor $browser: Removed the jshint globals that are not needed
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. |
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 |
I looked into the git history and there is no indicator that So this PR looks good to me. |
@andrewtarry I can't find your CLA signature. Have you signed it already? |
… 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
…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
…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
I have signed it online but it was only recent so it might not have been processed yet. |
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) |
otherwise you'll be bugged by the CLA robot in the future again |
I've resigned it. It was done from the office so had the wrong email. |
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.