Ox.URL: encode/decode '<' and '>' (fixes #1837)
This commit is contained in:
parent
0c60ca25da
commit
c7e25dc528
1 changed files with 8 additions and 2 deletions
|
@ -563,7 +563,9 @@ Ox.URL = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function decodeValue(value) {
|
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) {
|
function encodeValue(value, isItem) {
|
||||||
|
@ -575,7 +577,11 @@ Ox.URL = function(options) {
|
||||||
? '%' + char.charCodeAt(0).toString(16).toUpperCase()
|
? '%' + char.charCodeAt(0).toString(16).toUpperCase()
|
||||||
: char;
|
: 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) {
|
function isNumericalSpan(str) {
|
||||||
|
|
Loading…
Reference in a new issue