Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] Fix code scanning alert no. 370: Useless regular-expression cha…
…racter escape (#198264) (#198999) # Backport This will backport the following commits from `main` to `8.x`: - [Fix code scanning alert no. 370: Useless regular-expression character escape (#198264)](#198264) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kfir Peled","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-05T15:01:20Z","message":"Fix code scanning alert no. 370: Useless regular-expression character escape (#198264)\n\nFixes\r\n[https://github.com/elastic/kibana/security/code-scanning/370](https://github.com/elastic/kibana/security/code-scanning/370)\r\n\r\nTo fix the problem, we need to remove the unnecessary escape sequence\r\n`\\-` from the regular expression on line 32. This will not change the\r\nfunctionality of the code but will make the regular expression clearer\r\nand more maintainable.\r\n\r\n- In general terms, we need to ensure that only necessary escape\r\nsequences are used in regular expressions.\r\n- Specifically, we will update the regular expression on line 32 to\r\nremove the unnecessary escape sequence.\r\n- The change will be made in the file\r\n`x-pack/plugins/session_view/public/methods/index.tsx`.\r\n\r\n\r\n_Suggested fixes powered by Copilot Autofix. Review carefully before\r\nmerging._\r\n\r\n---------\r\n\r\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: @Omolola-Akinleye","sha":"ae2b3827f8237a07472699cfbd442a8bc567dc34","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:cloud-deploy"],"title":"Fix code scanning alert no. 370: Useless regular-expression character escape","number":198264,"url":"https://github.com/elastic/kibana/pull/198264","mergeCommit":{"message":"Fix code scanning alert no. 370: Useless regular-expression character escape (#198264)\n\nFixes\r\n[https://github.com/elastic/kibana/security/code-scanning/370](https://github.com/elastic/kibana/security/code-scanning/370)\r\n\r\nTo fix the problem, we need to remove the unnecessary escape sequence\r\n`\\-` from the regular expression on line 32. This will not change the\r\nfunctionality of the code but will make the regular expression clearer\r\nand more maintainable.\r\n\r\n- In general terms, we need to ensure that only necessary escape\r\nsequences are used in regular expressions.\r\n- Specifically, we will update the regular expression on line 32 to\r\nremove the unnecessary escape sequence.\r\n- The change will be made in the file\r\n`x-pack/plugins/session_view/public/methods/index.tsx`.\r\n\r\n\r\n_Suggested fixes powered by Copilot Autofix. Review carefully before\r\nmerging._\r\n\r\n---------\r\n\r\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: @Omolola-Akinleye","sha":"ae2b3827f8237a07472699cfbd442a8bc567dc34"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198264","number":198264,"mergeCommit":{"message":"Fix code scanning alert no. 370: Useless regular-expression character escape (#198264)\n\nFixes\r\n[https://github.com/elastic/kibana/security/code-scanning/370](https://github.com/elastic/kibana/security/code-scanning/370)\r\n\r\nTo fix the problem, we need to remove the unnecessary escape sequence\r\n`\\-` from the regular expression on line 32. This will not change the\r\nfunctionality of the code but will make the regular expression clearer\r\nand more maintainable.\r\n\r\n- In general terms, we need to ensure that only necessary escape\r\nsequences are used in regular expressions.\r\n- Specifically, we will update the regular expression on line 32 to\r\nremove the unnecessary escape sequence.\r\n- The change will be made in the file\r\n`x-pack/plugins/session_view/public/methods/index.tsx`.\r\n\r\n\r\n_Suggested fixes powered by Copilot Autofix. Review carefully before\r\nmerging._\r\n\r\n---------\r\n\r\nCo-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: @Omolola-Akinleye","sha":"ae2b3827f8237a07472699cfbd442a8bc567dc34"}}]}] BACKPORT--> Co-authored-by: Kfir Peled <[email protected]>
- Loading branch information