Skip to content

Commit 6ed2525

Browse files
Potential fix for code scanning alert no. 70: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6d875b5 commit 6ed2525

File tree

1 file changed

+2
-2
lines changed
  • apps/array/src/main/services

1 file changed

+2
-2
lines changed

apps/array/src/main/services/git.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ const replyToPullRequestComment = async (
680680
// Create a reply comment using the same commit, path, and line as the original
681681
const { stdout } = await execAsync(
682682
`gh api repos/${repo}/pulls/${prNumber}/comments ` +
683-
`-f body="${options.body.replace(/"/g, '\\"')}" ` +
683+
`-f body="${options.body.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}" ` +
684684
`-f commit_id="${originalComment.commit_id}" ` +
685685
`-f path="${originalComment.path}" ` +
686686
`-F line=${originalComment.line} ` +
@@ -710,7 +710,7 @@ const updatePullRequestComment = async (
710710
const repo = await getRepositoryFromRemoteUrl(directoryPath);
711711

712712
const { stdout } = await execAsync(
713-
`gh api repos/${repo}/pulls/comments/${commentId} -X PATCH -f body="${content.replace(/"/g, '\\"')}"`,
713+
`gh api repos/${repo}/pulls/comments/${commentId} -X PATCH -f body="${content.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`,
714714
{ cwd: directoryPath },
715715
);
716716

0 commit comments

Comments
 (0)