Skip to content

Conversation

@Git-Hub-Chris
Copy link
Owner

Potential fix for https://github.com/Git-Hub-Chris/MicrosoftVsCode/security/code-scanning/65

To fix the problem, we should replace the use of elm.replace("*", "") with a version that only removes the "*" marker if it is at the start of the string, and that is robust against branch names with asterisks elsewhere. The best approach is to use a regular expression that removes a leading asterisk, e.g., elm.replace(/^\*/, "") (or perhaps elm.replace(/^\*\s*/, "") to allow for optional whitespace). This ensures only the marker (not an asterisk contained in the branch name) is removed. This change should be made only on line 28 of extensions/terminal-suggest/src/completions/upstream/pnpm.ts. No new imports or major refactoring are needed; just update the usage of .replace() to use a regex.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Git-Hub-Chris and others added 2 commits September 15, 2025 07:37
…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Christopher Birnie-Browne <153604499+Git-Hub-Chris@users.noreply.github.com>
@Git-Hub-Chris Git-Hub-Chris marked this pull request as ready for review September 15, 2025 15:19
@Git-Hub-Chris Git-Hub-Chris merged commit 08363ea into Main Sep 15, 2025
11 checks passed
@Git-Hub-Chris Git-Hub-Chris deleted the alert-autofix-65 branch September 15, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants