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 427e952 commit 874d12d
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 'rison-node';
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 874d12d

Please sign in to comment.