Skip to content

Commit

Permalink
fix: CodeQL SM04509 issue (#4671)
Browse files Browse the repository at this point in the history
* Remove eval and eslint suppressions

* Ensure path is converted to string
  • Loading branch information
andres-robinet-sw authored Jun 4, 2024
1 parent 37c7b6a commit 67a5708
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libraries/botbuilder-lg/src/evaluationOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ export class EvaluationOptions {
this.strictMode = true;
}
} else if (key.toLowerCase() === this.replaceNullKey.toLowerCase()) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
this.nullSubstitution = (path) =>
// eslint-disable-next-line security/detect-eval-with-expression
eval('`' + value.replace(this.nullKeyReplaceStrRegex, '${path}') + '`'); // CodeQL [SM04509] Eval on content that is from a trusted source
this.nullSubstitution = (path) => value.replace(this.nullKeyReplaceStrRegex, `${path}`);
} else if (key.toLowerCase() === this.lineBreakKey.toLowerCase()) {
this.LineBreakStyle =
value.toLowerCase() === LGLineBreakStyle.Markdown.toString().toLowerCase()
Expand Down

0 comments on commit 67a5708

Please sign in to comment.