From e4033b1aa99530b3b6b6c068342a818896d8c176 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:55:35 +1100 Subject: [PATCH] [8.16] [CodeQL] resolve issue with incomplete string escaping (#196678) (#197084) # Backport This will backport the following commits from `main` to `8.16`: - [[CodeQL] resolve issue with incomplete string escaping (#196678)](https://github.com/elastic/kibana/pull/196678) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) \r\n\r\nCo-authored-by: Elastic Machine ","sha":"5fb1e127ad0c25b198a97753cbf53f8d714cb2ef","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:SharedUX","backport:prev-major","v7.17.25"],"title":"[CodeQL] resolve issue with incomplete string escaping","number":196678,"url":"https://github.com/elastic/kibana/pull/196678","mergeCommit":{"message":"[CodeQL] resolve issue with incomplete string escaping (#196678)\n\n## Summary\r\n\r\nRelates to https://github.com/elastic/kibana-team/issues/1102\r\n\r\nParticularly addresses issues with incomplete string escaping.\r\n\r\n\r\n\r\nCo-authored-by: Elastic Machine ","sha":"5fb1e127ad0c25b198a97753cbf53f8d714cb2ef"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196678","number":196678,"mergeCommit":{"message":"[CodeQL] resolve issue with incomplete string escaping (#196678)\n\n## Summary\r\n\r\nRelates to https://github.com/elastic/kibana-team/issues/1102\r\n\r\nParticularly addresses issues with incomplete string escaping.\r\n\r\n\r\n\r\nCo-authored-by: Elastic Machine ","sha":"5fb1e127ad0c25b198a97753cbf53f8d714cb2ef"}},{"branch":"7.17","label":"v7.17.25","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Eyo O. Eyo <7893459+eokoneyo@users.noreply.github.com> --- .../kbn-monaco/scripts/utils/create_autocomplete_definitions.js | 2 +- packages/kbn-monaco/src/painless/worker/painless_worker.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kbn-monaco/scripts/utils/create_autocomplete_definitions.js b/packages/kbn-monaco/scripts/utils/create_autocomplete_definitions.js index d6eeac2e20f61..3750b8697f493 100644 --- a/packages/kbn-monaco/scripts/utils/create_autocomplete_definitions.js +++ b/packages/kbn-monaco/scripts/utils/create_autocomplete_definitions.js @@ -36,7 +36,7 @@ const getDisplayName = (name, imported) => { displayName = name.split('.').pop() || name; } - return displayName.replace('$', '.'); + return displayName.replace(/^\$/g, '.'); }; /** diff --git a/packages/kbn-monaco/src/painless/worker/painless_worker.ts b/packages/kbn-monaco/src/painless/worker/painless_worker.ts index 332199f45b8ee..80489ccdbc589 100644 --- a/packages/kbn-monaco/src/painless/worker/painless_worker.ts +++ b/packages/kbn-monaco/src/painless/worker/painless_worker.ts @@ -44,7 +44,7 @@ export class PainlessWorker implements BaseWorkerDefinition { fields?: PainlessAutocompleteField[] ): PainlessCompletionResult { // Array of the active line words, e.g., [boolean, isTrue, =, true] - const words = currentLineChars.replace('\t', '').split(' '); + const words = currentLineChars.replace(/\t/g, '').split(/\s/); const autocompleteSuggestions: PainlessCompletionResult = getAutocompleteSuggestions( context,