diff --git a/assemblies/pentaho-war/src/main/webapp/js/ajaxslt/dom.js b/assemblies/pentaho-war/src/main/webapp/js/ajaxslt/dom.js index 4bb438206a7..121df038c10 100644 --- a/assemblies/pentaho-war/src/main/webapp/js/ajaxslt/dom.js +++ b/assemblies/pentaho-war/src/main/webapp/js/ajaxslt/dom.js @@ -34,7 +34,8 @@ // Spec. However, different browsers actually pass very different // values at the API. // -function xmlResolveEntities(s) { + + function xmlResolveEntities(s) { var parts = stringSplit(s, '&'); @@ -73,7 +74,7 @@ function xmlResolveEntities(s) { // through the W3C DOM. W3C DOM access is specified to resolve // entities. var span = window.document.createElement('span'); - span.innerHTML = '&' + rp[0] + '; '; + pho.util.xss.setHtml(span, '&' + rp[0] + '; '); ch = span.childNodes[0].nodeValue.charAt(0); } ret += ch + rp[1]; diff --git a/assemblies/pentaho-war/src/main/webapp/js/google-demo.js b/assemblies/pentaho-war/src/main/webapp/js/google-demo.js index 69a79992df7..b20c64160f6 100644 --- a/assemblies/pentaho-war/src/main/webapp/js/google-demo.js +++ b/assemblies/pentaho-war/src/main/webapp/js/google-demo.js @@ -86,7 +86,7 @@ greenicon = icon; function updateProductMix( content ) { document.getElementById( 'details-div' ).style.display='block'; - document.getElementById( 'details-cell1' ).innerHTML=content; + pho.util.xss.setHtml(document.getElementById('details-cell1'), content); pentahoAction( "steel-wheels", "google", "customer_details.xaction", new Array( new Array( "customer", currentRecord[7] ) ), 'updateHistory' @@ -95,7 +95,7 @@ greenicon = icon; function updateHistory( content ) { document.getElementById( 'details-div' ).style.display='block'; - document.getElementById( 'details-cell2' ).innerHTML=content; + pho.util.xss.setHtml(document.getElementById('details-cell2'), content); } function showAddress(address, name, custNum, value, selected) { @@ -191,6 +191,4 @@ function showAddress(address, name, custNum, value, selected) { 'updateInfoWindow' ); } - - } diff --git a/assemblies/pentaho-war/src/main/webapp/js/options.js b/assemblies/pentaho-war/src/main/webapp/js/options.js index e63b19043b0..56f3b5d66b5 100644 --- a/assemblies/pentaho-war/src/main/webapp/js/options.js +++ b/assemblies/pentaho-war/src/main/webapp/js/options.js @@ -20,11 +20,11 @@ function runInBackground( url, target ) url = url + "&background=true"; if ( target.toLowerCase().indexOf( 'new' ) >= 0 ) { - var targetWin = window.open( url ); + var targetWin = window.open(pho.util.xss.sanitizeUrl(url)); } else { - window.location = url; + window.location = pho.util.xss.sanitizeUrl(url); } } return undefined; // forces current page to remain unchanged when target=new diff --git a/assemblies/pentaho-war/src/main/webapp/js/parameters.js b/assemblies/pentaho-war/src/main/webapp/js/parameters.js index 7c7424551d5..c9030753176 100644 --- a/assemblies/pentaho-war/src/main/webapp/js/parameters.js +++ b/assemblies/pentaho-war/src/main/webapp/js/parameters.js @@ -360,7 +360,7 @@ function executeAction (target, submitUrl) { // convert characters from entities like ı to display characters (HTML) function convertHtmlEntitiesToCharacters(theStr) { var newDiv = document.createElement(newDiv); - newDiv.innerHTML = theStr; + pho.util.xss.setHtml(newDiv, theStr); return newDiv.innerHTML; } diff --git a/assemblies/pentaho-war/src/main/webapp/js/src/html/util.js b/assemblies/pentaho-war/src/main/webapp/js/src/html/util.js index 4bd8ee853bd..79623b6caed 100644 --- a/assemblies/pentaho-war/src/main/webapp/js/src/html/util.js +++ b/assemblies/pentaho-war/src/main/webapp/js/src/html/util.js @@ -210,7 +210,7 @@ dojo.html.createNodesFromText = function(/* string */txt, /* boolean? */trim){ txt = "