Ox.URL: encode ' ' as '_' and '_' as '%09' (tab)

This commit is contained in:
rlx 2013-08-14 19:26:14 +00:00
parent 08256a078f
commit 5afbd57823

View file

@ -563,7 +563,7 @@ Ox.URL = function(options) {
} }
function decodeValue(value) { function decodeValue(value) {
return Ox.decodeURIComponent(value); return Ox.decodeURIComponent(value).replace(/_/g, ' ').replace(Ox.char(9), '_');
} }
function encodeValue(value) { function encodeValue(value) {
@ -576,7 +576,7 @@ Ox.URL = function(options) {
? '%' + char.charCodeAt(0).toString(16).toUpperCase() ? '%' + char.charCodeAt(0).toString(16).toUpperCase()
: char; : char;
}); });
return ret; return ret.replace(/_/g, '%09').replace(/\s/g, '_');
} }
function isNumericalSpan(str) { function isNumericalSpan(str) {