Skip to content

Commit

Permalink
Fix code scanning alert no. 331: Inefficient regular expression
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
kdinev and github-advanced-security[bot] authored Nov 5, 2024
1 parent 397477d commit e864cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
/* type="RegExp" Matches any substitution element in the template that is to be rendered as it is
Use $.ig.regExp.sub.exec(tmpl) in order to get the substitution element in the tmpl string
*/
nonEncodeSub: /\{\{html\s+([^\s{}]+(?:\.[^\s{}]+)*)\}\}/,
nonEncodeSub: /\{\{html\s+([^\s{}]+(?:\.[^\s{}]+?)*)\}\}/,

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '{{html !.' and containing many repetitions of '!.'.
forSub: /\$\{([\w\$]+\.[\w\$]+(?:\.[\w\$]+)*)\}/,
arg: /args\[\d+\](?!.*\+)/,
/* type="RegExp" Matches any block directive in the template
Expand Down

0 comments on commit e864cc2

Please sign in to comment.