Skip to content

Only hyperlink proper http urls#481

Merged
ngundotra merged 1 commit intomasterfrom
enforce-good-behavior
Mar 5, 2025
Merged

Only hyperlink proper http urls#481
ngundotra merged 1 commit intomasterfrom
enforce-good-behavior

Conversation

@ngundotra
Copy link
Copy Markdown
Contributor

@ngundotra ngundotra commented Mar 5, 2025

Description

Security related

Type of change

  • Bug fix

Testing

Tested locally


Important

Fixes hyperlinking to only allow HTTP URLs in TokenAccountSection.tsx.

  • Behavior:
    • In TokenAccountSection.tsx, only URLs starting with 'http' are hyperlinked in the TokenExtensionRows function.
    • Non-HTTP URLs are displayed as plain text, preventing them from being clickable.

This description was created by Ellipsis for 95fcb7d. It will automatically update as commits are pushed.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2025 6:06am

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 95fcb7d in 1 minute and 9 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. app/components/account/TokenAccountSection.tsx:972
  • Draft comment:
    Ensure that the 'http' check covers all valid protocols (e.g. HTTPS) and consider a case-insensitive check if needed. Otherwise, the update correctly prevents linking non-http URLs.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    While the suggestion to use a case-insensitive regex is technically more thorough, the current implementation is likely sufficient for real-world URIs. The vast majority of URIs will use lowercase 'http' or 'https'. The suggestion is more of an edge case optimization than fixing a real problem. Additionally, the comment is somewhat speculative with "if needed".
    The current code could theoretically miss URIs that start with HTTP or HTTPS in uppercase. The regex would be more robust.
    However, uppercase HTTP/HTTPS protocols are extremely rare in practice, and the current code handles the 99.9% case well. The added complexity of regex may not be worth it for such an edge case.
    This comment should be deleted as it suggests a more complex solution for an edge case that rarely occurs in practice.
2. app/components/account/TokenAccountSection.tsx:970
  • Draft comment:
    Good improvement: hyperlink only when the URI starts with 'http'. Consider a slightly stricter validation (e.g. using a regex like /^https?:///) and trimming the URI to avoid whitespace issues.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None

Workflow ID: wflow_Lb3vWq4cLq9PaIuY


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@ngundotra ngundotra merged commit 28aa208 into master Mar 5, 2025
3 checks passed
@ngundotra ngundotra deleted the enforce-good-behavior branch March 5, 2025 06:09
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.

1 participant