Skip to content

Commit

Permalink
Implemented poor string replacements for filtering sensitive info fro…
Browse files Browse the repository at this point in the history
…m module settings.
  • Loading branch information
Ethck committed Apr 7, 2021
1 parent 2ccce06 commit 62aaefa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Module/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const generateModuleSettings = (mod) => {
if (setting.module === mod.data.name) {
// only allow scalars
if (setting.config && setting.type !== "object") {
const ignore = ["cookie", "password", "secret", "token", "bearer", "email"].some(badKey => setting.key.includes(badKey));
let trimmedKey = setting.key.replace("-", "").replace("_", "").replace(" ", "").toLowerCase();
const ignore = ["cookie", "password", "secret", "token", "bearer", "email"].some(badKey => trimmedKey.includes(badKey));
if (!ignore){
let setVal = game.settings.get(mod.data.name, setting.key);
modSettings.push(`${setting.key}: ${setVal}`);
Expand Down

0 comments on commit 62aaefa

Please sign in to comment.