Skip to content

Commit dc0c401

Browse files
committed
fixing internal strictEncodeURIComponent() to work in Firefox 3.6 - closes #91
1 parent bd20c5b commit dc0c401

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m
209209

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

212+
* fixing internal `strictEncodeURIComponent()` to work in Firefox 3.6 - ([Issue #91](https://github.com/medialize/URI.js/issues/91))
212213
* 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))
213214
* 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))
214215
* 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))

src/URI.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,17 @@ URI.getDomAttribute = function(node) {
223223

224224
return URI.domAttributes[nodeName];
225225
};
226+
227+
function escapeForDumbFirefox36(value) {
228+
// https://github.com/medialize/URI.js/issues/91
229+
return escape(value);
230+
}
231+
226232
// encoding / decoding according to RFC3986
227233
function strictEncodeURIComponent(string) {
228234
// see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent
229235
return encodeURIComponent(string)
230-
.replace(/[!'()*]/g, escape)
236+
.replace(/[!'()*]/g, escapeForDumbFirefox36)
231237
.replace(/\*/g, "%2A");
232238
}
233239
URI.encode = strictEncodeURIComponent;

0 commit comments

Comments
 (0)