Skip to content

Commit

Permalink
Fix code scanning alert #419: Incomplete string escaping or encoding (#…
Browse files Browse the repository at this point in the history
…193365)

Fixes
[https://github.com/elastic/kibana/security/code-scanning/419](https://github.com/elastic/kibana/security/code-scanning/419)

_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
smith and github-advanced-security[bot] authored Sep 20, 2024
1 parent 374351a commit 35edfd0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const createFilterFromOptions = (
filters.push(options.filterQuery);
}
if (options.groupBy) {
const id = series.id.replace('"', '\\"');
const id = series.id.replace(/"/g, '\\"');
const groupByFilters = Array.isArray(options.groupBy)
? options.groupBy
.map((field, index) => {
Expand All @@ -125,7 +125,7 @@ export const createFilterFromOptions = (
if (!value) {
return null;
}
return `${field}: "${value.replace('"', '\\"')}"`;
return `${field}: "${value.replace(/"/g, '\\"')}"`;
})
.join(' and ')
: `${options.groupBy} : "${id}"`;
Expand Down

0 comments on commit 35edfd0

Please sign in to comment.