Skip to content

Commit 28aa208

Browse files
authored
Only hyperlink proper http urls (#481)
## Description Security related <!-- Provide a brief description of the changes in this PR --> ## Type of change - [x] Bug fix ## Testing Tested locally <!-- ELLIPSIS_HIDDEN --> ---- > [!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. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=solana-foundation%2Fexplorer&utm_source=github&utm_medium=referral)<sup> for 95fcb7d. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 638c967 commit 28aa208

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/components/account/TokenAccountSection.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,14 @@ function TokenExtensionRows(
969969
<tr>
970970
<td>URI</td>
971971
<td className="text-lg-end">
972-
<a rel="noopener noreferrer" target="_blank" href={extension.uri}>
973-
{extension.uri}
974-
<ExternalLink className="align-text-top ms-2" size={13} />
975-
</a>
972+
{extension.uri.startsWith('http') ? (
973+
<a rel="noopener noreferrer" target="_blank" href={extension.uri}>
974+
{extension.uri}
975+
<ExternalLink className="align-text-top ms-2" size={13} />
976+
</a>
977+
) : (
978+
extension.uri
979+
)}
976980
</td>
977981
</tr>
978982
{extension.additionalMetadata?.length > 0 && (

0 commit comments

Comments
 (0)