fix query parser

This commit is contained in:
rolux 2013-02-12 14:24:53 +05:30
parent 6cb65d131c
commit 8079671cf1

View file

@ -244,10 +244,11 @@ Ox.load('UI', {
vars.forEach(function(v) {
var kv = v.split('='), k = kv[0], v = kv[1];
query[k] = decodeURIComponent(v);
query[k] = {
'true': true, 'false': false
}[query[k]] || query[k];
if (query[k].match(/^[\d\.]+$/)) {
if (query[k] == 'true') {
query[k] = true;
} else if (query[k] == 'false') {
query[k] = false;
} else if (query[k].match(/^[\d\.]+$/)) {
query[k] = parseFloat(query[k]);
}
});