Skip to content

Commit 863d2c3

Browse files
committed
issue doxygen#11563 navtree.js causes Content Security Policy violation with evaluated javascript
1 parent 10d9a9d commit 863d2c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

templates/html/navtree.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ function initNavTree(toroot,relpath,allMembersFile) {
4949
const getData = function(varName) {
5050
const i = varName.lastIndexOf('/');
5151
const n = i>=0 ? varName.substring(i+1) : varName;
52-
return eval(n.replace(/-/g,'_'));
52+
const e = n.replace(/-/g,'_');
53+
return window[e];
5354
}
5455

5556
const stripPath = function(uri) {
@@ -395,7 +396,7 @@ function initNavTree(toroot,relpath,allMembersFile) {
395396
gotoNode(o,i,root,hash,relpath)
396397
} else {
397398
getScript(relpath+'navtreeindex'+i,function() {
398-
navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);
399+
navTreeSubIndices[i] = window['NAVTREEINDEX'+i];
399400
if (navTreeSubIndices[i]) {
400401
gotoNode(o,i,root,hash,relpath);
401402
}

0 commit comments

Comments
 (0)