Skip to content

Commit

Permalink
[Lens] escape backslash characters in the formula input (elastic#196171)
Browse files Browse the repository at this point in the history
## Summary

Ensures that backslashes are properly escaped in addition to single
quotes in formula
  • Loading branch information
mbondyra authored Oct 15, 2024
1 parent 563910b commit e0251df
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function generateFormula(
}
previousFormula +=
(previousColumn.filter.language === 'kuery' ? 'kql=' : 'lucene=') +
`'${previousColumn.filter.query.replace(/'/g, `\\'`)}'`; // replace all
`'${previousColumn.filter.query.replace(/\\/g, '\\\\').replace(/'/g, `\\'`)}'`; // replace all
}
if (previousColumn.timeShift) {
if (
Expand Down

0 comments on commit e0251df

Please sign in to comment.