Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

decodeURIComponent - prevent URIError #13993

Open
modmac wants to merge 1 commit into angular:master
base: master
Choose a base branch
Loading
from modmac:patch-1
Open

decodeURIComponent - prevent URIError #13993

modmac wants to merge 1 commit into angular:master from modmac:patch-1

Conversation

@modmac
Copy link

@modmac modmac commented Feb 10, 2016

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

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

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.

Copy link
Author

modmac commented Feb 10, 2016

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

CLAs look good, thanks!

1 similar comment
Copy link

CLAs look good, thanks!

Copy link
Member

gkalpak commented Feb 10, 2016

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.

Copy link
Author

modmac commented Feb 11, 2016

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?

Copy link
Member

gkalpak commented Feb 11, 2016

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 ?

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /