Skip to content

Potential fix for code scanning alert no. 17: Incomplete string escaping or encoding - #205

Open
Dargon789 wants to merge 2 commits into
masterfrom
alert-autofix-17
Open

Potential fix for code scanning alert no. 17: Incomplete string escaping or encoding#205
Dargon789 wants to merge 2 commits into
masterfrom
alert-autofix-17

Conversation

@Dargon789

@Dargon789 Dargon789 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/Dargon789/mempool/security/code-scanning/17

Use a global replacement so all & characters are handled consistently.

Best minimal fix (no behavior change beyond correcting the bug): in frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts, update line 144 from string-based replace to regex-based global replace:

  • From: isp[1].replace('&', '')
  • To: isp[1].replace(/&/g, '')

No new imports, methods, or dependencies are required.

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

Summary by Sourcery

Bug Fixes:

  • Fix incomplete removal of ampersand characters in ISP labels by applying the replacement globally.

…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
@codesandbox

codesandbox Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mempool Ready Ready Preview, Comment Jun 1, 2026 11:44pm

@snyk-io

snyk-io Bot commented Jun 1, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@sourcery-ai

sourcery-ai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces a single-occurrence string replace with a global regex replace to correctly remove all '&' characters from ISP names when building chart labels, addressing an incomplete escaping/encoding issue without altering other behavior.

File-Level Changes

Change Details Files
Ensure all '&' characters are stripped from ISP names when constructing chart labels.
  • Changed string-based replace call to a regex-based global replace so multiple '&' characters are removed, not just the first occurrence
  • Kept the rest of the label construction logic (mobile/widget checks and percentage suffix) unchanged to avoid behavioral regressions
frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Dargon789
Dargon789 marked this pull request as ready for review June 1, 2026 23:26

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Dargon789, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the ISP name formatting in the nodes-per-isp-chart component to replace all occurrences of the ampersand character using a global regular expression. The reviewer suggests adding a fallback or optional chaining to prevent potential runtime errors if the ISP name is null or undefined.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread frontend/src/app/lightning/nodes-per-isp-chart/nodes-per-isp-chart.component.ts Outdated
…hart.component.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
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.

Sequence diagram for Vercel analytics initialization on Angular app startup

1 participant