From a59977f181170ab1e104e07bc9a24d3af5355b5b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 5 Jun 2020 08:57:30 +0200 Subject: [PATCH] js: Properly parse/build url query values fixes #4167 --- public/js/icinga/utils.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/public/js/icinga/utils.js b/public/js/icinga/utils.js index 33b7965f0..145847afa 100644 --- a/public/js/icinga/utils.js +++ b/public/js/icinga/utils.js @@ -204,8 +204,17 @@ } query += params[i].key; - if (params[i].value !== null) { - query += '=' + params[i].value; + switch (params[i].value) { + case true: + break; + case false: + query += '=0'; + break; + case null: + query += '='; + break; + default: + query += '=' + params[i].value; } } @@ -235,7 +244,7 @@ value = segment[i].slice(equalPos + 1); } else { key = segment[i]; - value = null; + value = true; } params.push({ key: key, value: value });