Skip to content

Commit

Permalink
Merge pull request #21 from drzo/autofix/alert-59-9f2e6b9444
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 59: Code injection
  • Loading branch information
drzo authored Oct 5, 2024
2 parents e744de6 + c0fd9dc commit f17432f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions influent-client/src/main/requirejs/r.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ var requirejs, require, define, xpcUtil;

readFile = xpcUtil.readFile;

exec = function (string) {
return eval(string);
exec = function (config) {
if (typeof require === 'function') {
require.config(config);
}
};

exists = function (fileName) {
Expand Down Expand Up @@ -27800,7 +27802,7 @@ define('build', function (require) {
dir.pop();
dir = dir.join('/');
//Make sure dir is JS-escaped, since it will be part of a JS string.
exec("require({baseUrl: '" + dir.replace(/[\\"']/g, '\\$&') + "'});");
exec({baseUrl: dir.replace(/[\\"']/g, '\\$&')});
}
}

Expand Down

0 comments on commit f17432f

Please sign in to comment.