Skip to content

Instantly share code, notes, and snippets.

@wizard04wsu
Last active August 29, 2015 13:56
Show Gist options
  • Save wizard04wsu/8830686 to your computer and use it in GitHub Desktop.
Save wizard04wsu/8830686 to your computer and use it in GitHub Desktop.
Fixes encodeURI() to comply with RFC 3986 where "[" and "]" are reserved characters.
(function (){
"use strict";
var oldEncodeURI = encodeURI;
encodeURI = function encodeURI(str){ return oldEncodeURI(str).replace(/%5B/ig, "[").replace(/%5D/ig, "]"); };
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment