From 8079671cf15f3dba8ffbe70b35e0c33e1ce6f32d Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 12 Feb 2013 14:24:53 +0530 Subject: [PATCH] fix query parser --- static/js/embed/pandora.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index 1360d8a86..bde02c3e8 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -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]); } });