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

xss fix with ESAPI #2

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion apps/SentinelWMTS/SentinelWMTS.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* WebWorldWind can be found in the WebWorldWind 3rd-party notices and licenses
* PDF found in code directory.
*/
var ESAPI = require('node-esapi');
define(['../../src/WorldWind',
'../util/GoToBox',
'../util/LayersPanel',
Expand Down Expand Up @@ -105,7 +106,7 @@ define(['../../src/WorldWind',
var allWmtsLayers = wmtsCapabilities.getLayers();
for (var i = 0; i < allWmtsLayers.length; i++) {
var layerItem = $('<li><a data-id="' + allWmtsLayers[i].identifier + '">' + allWmtsLayers[i].titles[0].value + '</a></li>');
ulItem.append(decodeUri(layerItem));
ulItem.append('url(<%=ESAPI.encoder().encodeForJS(ESAPI.encoder().encodeForURL(layerItem))%>)');
}

ulItem = $('</ul>');
Expand Down