Skip to content

Commit f17432f

Browse files
authored
Merge pull request #21 from drzo/autofix/alert-59-9f2e6b9444
Fix code scanning alert no. 59: Code injection
2 parents e744de6 + c0fd9dc commit f17432f

File tree

1 file changed

+5
-3
lines changed
  • influent-client/src/main/requirejs

1 file changed

+5
-3
lines changed

influent-client/src/main/requirejs/r.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ var requirejs, require, define, xpcUtil;
218218

219219
readFile = xpcUtil.readFile;
220220

221-
exec = function (string) {
222-
return eval(string);
221+
exec = function (config) {
222+
if (typeof require === 'function') {
223+
require.config(config);
224+
}
223225
};
224226

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

0 commit comments

Comments
 (0)