From df57bd6f9edf7d839cd40fdd3e7bb8b60bcfd35e Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 15 Dec 2015 09:50:36 -0800 Subject: [PATCH] Encode query uri component properly Previously we used encodeURI() to encode a single component of a URI, this meant that characters like = were not encoded. This isn't correct bceause we are just encoding a single component and need = to be encoded. Fix this by using encodeURIComponent which should do the right thing. Change-Id: Ib320c1e646ccbd2233bd9d7a2be9df29ff7bd1ed --- files/dashLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/dashLoader.js b/files/dashLoader.js index 31850bb..b19f750 100644 --- a/files/dashLoader.js +++ b/files/dashLoader.js @@ -58,7 +58,7 @@ function (angular, _) { id : "urllink", // Note that we hvae to do the encode json thing because kibana // wants the parameters to be json quoted then url quoted ... :( - link : window.location.href.replace(window.location.hash,"")+"#dashboard/file/logstash.json?query="+encodeURI(JSON.stringify(dashboard.current.services.query.list[0].query).slice(1,-1)), + link : window.location.href.replace(window.location.hash,"")+"#dashboard/file/logstash.json?query="+encodeURIComponent(JSON.stringify(dashboard.current.services.query.list[0].query).slice(1,-1)), title : "Share URL" }; return;