strictEncodeURIComponent fails in FF 3.6 #91

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

Comments

Projects
None yet
2 participants

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);}
Owner

rodneyrehm commented May 22, 2013

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

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.

Owner

rodneyrehm commented May 22, 2013

let me get this straight, your fix is replacing

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

with

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

and that's it?

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

Owner

rodneyrehm commented May 23, 2013

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

great, thanks!

Owner

rodneyrehm commented Aug 3, 2013

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

rodneyrehm closed this Aug 3, 2013

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