Skip to content

Commit

Permalink
[Graph] Escape backslash characters in the graph encode functions (el…
Browse files Browse the repository at this point in the history
…astic#196239)

## Summary

Escape backslash characters in the graph encode functions.

(cherry picked from commit 57c4b40)
  • Loading branch information
mbondyra committed Oct 17, 2024
1 parent bef9771 commit 22bd31d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/public/helpers/kql_encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import rison from '@kbn/rison';
import { Workspace } from '../types';

function escapeQuotes(str: string) {
return str.replace(/"/g, '\\"');
return str.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
}

export function asKQL(workspace: Workspace, joinBy: 'and' | 'or') {
Expand Down

0 comments on commit 22bd31d

Please sign in to comment.