Ox.URL: encode/decode '<' and '>' (fixes #1837)

This commit is contained in:
rlx 2013-08-27 15:12:19 +00:00
parent 0c60ca25da
commit c7e25dc528

View file

@ -563,7 +563,9 @@ Ox.URL = function(options) {
}
function decodeValue(value) {
return Ox.decodeURIComponent(value).replace(/_/g, ' ').replace(/\t/g, '_');
return Ox.decodeURIComponent(value)
.replace(/_/g, ' ').replace(/\t/g, '_')
.replace(/\x0E/g, '<').replace(/\x0F/g, '>');
}
function encodeValue(value, isItem) {
@ -575,7 +577,11 @@ Ox.URL = function(options) {
? '%' + char.charCodeAt(0).toString(16).toUpperCase()
: char;
});
return ret.replace(/_/g, '%09').replace(/\s/g, '_');
ret = ret.replace(/_/g, '%09').replace(/\s/g, '_');
if (!isItem) {
ret = ret.replace(/</g, '%0E').replace(/>/g, '%0F');
}
return ret;
}
function isNumericalSpan(str) {