Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strictEncodeURIComponent fails in FF 3.6 #91

Closed
NetForce1 opened this issue May 22, 2013 · 7 comments
Closed

strictEncodeURIComponent fails in FF 3.6 #91

NetForce1 opened this issue May 22, 2013 · 7 comments
Labels

Comments

@NetForce1
Copy link

Calling strictEncodeURIComponent with some specific values cause an error in FF 3.6.

strictEncodeURIComponent('abcdefg()') // -> Error: invalid string escape mask 8

I hotfixed this by replacing the escape-function that is passed into replace with:

function(val) {return escape(val);}
@rodneyrehm
Copy link
Member

Firefox 3.6, seriously? we're at 21. twentyone!

@NetForce1
Copy link
Author

Sure, we don't like it either, but in one of our products we embed that browser (or xulrunner actually). And it's not that easy to upgrade.

@rodneyrehm
Copy link
Member

let me get this straight, your fix is replacing

.replace(/[!'()*]/g, escape)

with

.replace(/[!'()*]/g, function(v){return escape(v); })

and that's it?

@NetForce1
Copy link
Author

yep, that's it. It seems like FF 3.6 has some limitations in accessing native functions, I suppose this issue: jashkenas/backbone#2417 falls into the same category.

@rodneyrehm
Copy link
Member

well, that's easy enough. I'll include that in the next version

@NetForce1
Copy link
Author

great, thanks!

@rodneyrehm
Copy link
Member

I've fixed this in master - it will be included in the next release. thank you for your help!

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

No branches or pull requests

2 participants