Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed scripting issues due to improperly encoded kibana payload #7568

Merged
merged 3 commits into from
Jun 28, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/ui/views/chrome.jade
Original file line number Diff line number Diff line change
@@ -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 = '</" + "script>';
return JSON.stringify(data).replace(scriptend, concatend);
}

block vars

Expand All @@ -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