Skip to content

Commit 1a6f914

Browse files
Potential fix for code scanning alert no. 58: Double escaping or unescaping (#5747)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 0140ba4 commit 1a6f914

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/components/nodes/agentflow/Tool

packages/components/nodes/agentflow/Tool/Tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ class Tool_Agentflow implements INode {
236236
// ex: \["a", "b", "c", "d", "e"\]
237237
let cleanedValue = value
238238
.replace(/\\"/g, '"') // \" -> "
239-
.replace(/\\\\/g, '\\') // \\ -> \
240239
.replace(/\\\[/g, '[') // \[ -> [
241240
.replace(/\\\]/g, ']') // \] -> ]
242241
.replace(/\\\{/g, '{') // \{ -> {
243242
.replace(/\\\}/g, '}') // \} -> }
243+
.replace(/\\\\/g, '\\') // \\ -> \ (unescape backslash last)
244244

245245
// Try to parse as JSON if it looks like JSON/array
246246
if (

0 commit comments

Comments
 (0)