Skip to content

Commit

Permalink
fixing internal strictEncodeURIComponent() to work in Firefox 3.6 - c…
Browse files Browse the repository at this point in the history
…loses #91
  • Loading branch information
rodneyrehm committed Aug 3, 2013
1 parent bd20c5b commit dc0c401
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m

### `[dev-version]` (master branch) ###

* fixing internal `strictEncodeURIComponent()` to work in Firefox 3.6 - ([Issue #91](https://github.com/medialize/URI.js/issues/91))
* fixing [`.normalizePath()`](http://medialize.github.io/URI.js/docs.html#normalize-path) to properly resolve `/.//` to `/` - ([Issue #97](https://github.com/medialize/URI.js/issues/97))
* fixing [`path()`](http://medialize.github.io/URI.js/docs.html#accessors-pathname) to return empty string if there is no path - ([Issue #82](https://github.com/medialize/URI.js/issues/82))
* fixing crashing of `URI.decodeQuery()` on malformed input - now returns original undecoded data - ([Issue #87](https://github.com/medialize/URI.js/issues/87), [Issue #92](https://github.com/medialize/URI.js/issues/92))
Expand Down
8 changes: 7 additions & 1 deletion src/URI.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,17 @@ URI.getDomAttribute = function(node) {

return URI.domAttributes[nodeName];
};

function escapeForDumbFirefox36(value) {
// https://github.com/medialize/URI.js/issues/91
return escape(value);
}

// encoding / decoding according to RFC3986
function strictEncodeURIComponent(string) {
// see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent
return encodeURIComponent(string)
.replace(/[!'()*]/g, escape)
.replace(/[!'()*]/g, escapeForDumbFirefox36)
.replace(/\*/g, "%2A");
}
URI.encode = strictEncodeURIComponent;
Expand Down

0 comments on commit dc0c401

Please sign in to comment.