From aa5d7227e3678051fa989b223539cc60dbb2a041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Bevacqua?= Date: Tue, 28 Jun 2016 16:44:18 -0300 Subject: [PATCH] [fix] Fixed scripting issues due to improperly encoded kibana payload. Former-commit-id: 08a6f401666c96580d3dbb63cb620a6a641176a3 --- src/ui/views/chrome.jade | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ui/views/chrome.jade b/src/ui/views/chrome.jade index 646b9bd329a45..357258de1b435 100644 --- a/src/ui/views/chrome.jade +++ b/src/ui/views/chrome.jade @@ -1,5 +1,11 @@ -- var j = function (o) { return JSON.stringify(o); } -- var appName = 'kibana'; +- + var appName = 'kibana'; + + function encoded (data) { + var scriptend = /\<\s*\/\s*script\s*>/ig; + var concatend = ''; + return JSON.stringify(data).replace(scriptend, concatend); + } block vars @@ -12,5 +18,5 @@ html(lang='en') title Kibana block head body(kbn-chrome, id='#{appName}-body') - script window.__KBN__ = !{j(kibanaPayload)}; + script window.__KBN__ = !{encoded(kibanaPayload)}; block content