FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

decodeURIComponent - prevent URIError by modmac · Pull Request #13993 · angular/angular.js · GitHub

This repository was archived by the owner on Apr 12, 2024. It is now read-only.
/ angular.js Public archive

decodeURIComponent - prevent URIError - #13993

Open
modmac wants to merge 1 commit into
angular:masterfrom
modmac:patch-1
Open

decodeURIComponent - prevent URIError#13993
modmac wants to merge 1 commit into
angular:masterfrom
modmac:patch-1

Conversation

modmac commented Feb 10, 2016

Copy link
Copy Markdown

Replace decodeURIComponent with tryDecodeURIComponent to prevent throwing "URIError: malformed URI sequence".

https://github.com/angular/angular.js/blob/master/src/Angular.js#L1275

Replace decodeURIComponent with tryDecodeURIComponent to prevent throwing "URIError: malformed URI sequence".

https://github.com/angular/angular.js/blob/master/src/Angular.js#L1275

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

modmac commented Feb 10, 2016

Copy link
Copy Markdown
Author

I signed it!

2016-02-10 15:34 GMT+01:00 googlebot notifications@github.com:

Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).

[image: 📝] Please visit https://cla.developers.google.com/
https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll

verify. Thanks.


Reply to this email directly or view it on GitHub
#13993 (comment).

Copy link
Copy Markdown

CLAs look good, thanks!

1 similar comment

Copy link
Copy Markdown

CLAs look good, thanks!

gkalpak commented Feb 10, 2016

Copy link
Copy Markdown
Member

I think this will break the contract that $location.path() or $location.hash() return a string.
OOC, under what circumstances can this error been thrown ? Do you have a reproduction.

There should also be some tests, verifying the new behavior and guarding against regressions.

modmac commented Feb 11, 2016

Copy link
Copy Markdown
Author

Yes, try to request a page with a #% hash in the URL.

Example:
https://console.developers.google.com/freetrial?newProject=false#%

Maybe in this example, if decodeURIComponent throws an error, we should catch it and encode hash/uri to keep wrong characters (ex. single %) as encoded UTF?

gkalpak commented Feb 11, 2016

Copy link
Copy Markdown
Member

Aha, I see the error.

TBH, trying to guess and fix unencoded UTF characters is a business I'd rather not be into :)
That said, silently failing on invalid URLs, won't be fun to debug. I think it's better to throw here.

@petebacondarwin, wdyt ?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL