Skip to content

Commit

Permalink
Fix code scanning alert no. 5: Incomplete string escaping or encoding
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 15, 2024
1 parent da1793f commit 95d8cba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/js/modules/infragistics.templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@
splitName = tempToken[ 1 ].split(".");

// K.D. September 25th, 2012 Bug #122463 The property can contain $ in its name.
template = template.replace(new RegExp("\\$\\{" + tempToken[ 1 ].replace(/\$/g, "\\$") + "\\}", "g"), "");
tempToken[ 3 ] = new RegExp("\\$\\{" + tempToken[ 1 ].replace(/\$/g, "\\$") + "\\}", "g");
tempToken[ 1 ] = tempToken[ 1 ].replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
template = template.replace(new RegExp("\\$\\{" + tempToken[ 1 ] + "\\}", "g"), "");
tempToken[ 3 ] = new RegExp("\\$\\{" + tempToken[ 1 ] + "\\}", "g");
tempToken[ 1 ] = splitName;
tempToken[ 2 ] = true;
this.tokens.push(tempToken);
Expand All @@ -200,8 +201,9 @@
splitName = tempToken[ 1 ].split(".");

// K.D. September 25th, 2012 Bug #122463 The property can contain $ in its name.
template = template.replace(new RegExp("\\{\\{html\\s+" + tempToken[ 1 ].replace(/\$/g, "\\$") + "\\}\\}", "g"), "");
tempToken[ 3 ] = new RegExp("\\{\\{html\\s+" + tempToken[ 1 ].replace(/\$/g, "\\$") + "\\}\\}", "g");
tempToken[ 1 ] = tempToken[ 1 ].replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
template = template.replace(new RegExp("\\{\\{html\\s+" + tempToken[ 1 ] + "\\}\\}", "g"), "");
tempToken[ 3 ] = new RegExp("\\{\\{html\\s+" + tempToken[ 1 ] + "\\}\\}", "g");
tempToken[ 1 ] = splitName;
tempToken[ 2 ] = false;
this.tokens.push(tempToken);
Expand Down

0 comments on commit 95d8cba

Please sign in to comment.