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

$location.hashSearch breaks Firefox #492

Closed
groner opened this issue Jul 28, 2011 · 6 comments
Closed

$location.hashSearch breaks Firefox #492

groner opened this issue Jul 28, 2011 · 6 comments

Comments

@groner
Copy link
Contributor

groner commented Jul 28, 2011

Firefox decodes the hash part of a URL and breaks if %XX encoding of high-bit bytes aren't UTF-8.

Examples:
Firefox works: http://server/app#?filter=PIHLSTR%C3%96M
Firefox breaks: http://server/app#?filter=PIHLSTR%D6M

Updating location.hash/href or calling location.assign()/replace() is the same. There's no exception, navigation just doesn't happen.

I've found this in Firefox 3.6 and 5.0. There are a few bugs discussing it, but it doesn't seem like a fix is imminent.

@groner
Copy link
Contributor Author

groner commented Jul 28, 2011

It appears that this could be fixed by changing toKeyValue() and parseKeyValue() use encodeURIQuery() instead of escape(). Is there a reason that these routines are using escape()?

@ghost ghost assigned vojtajina Jul 29, 2011
@vojtajina
Copy link
Contributor

Thanks groner, it looks like your proposal is sensible to do...

@IgorMinar
Copy link
Contributor

right. escape should not be used here. can't we safely switch to using encodeUriSegment?

@vojtajina
Copy link
Contributor

From $location point of view - path and hash are encoded using our custom encodeUriSegment function.
As $location is currently the only place where toKeyValue is used, we should probably use encodeUriQuery...

@IgorMinar
Copy link
Contributor

@vojtajina
Copy link
Contributor

You are right Igor, but new $location uses our custom encodeUriSegment for hash and path, but toKeyValue for search, which uses escape... So we need to change toKeyValue to use our custom encodeUriQuery...

groner added a commit to groner/angular.js that referenced this issue Sep 5, 2011
…to,from}KeyValue

This is bug angular#492, but I can't wait for the $location service rewrite.
groner added a commit to groner/angular.js that referenced this issue Sep 5, 2011
…to,from}KeyValue

This is bug angular#492, but I can't wait for the $location service rewrite.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants