Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly escape special characters in profile name links #433

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/owner-list/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const OwnerList = ({ owners }) => {
<div key={holder_address} className={styles.owner}>
{amount}&nbsp;ed.&nbsp;
{get(holder_profile, 'name') ? (
<Button to={`/${get(holder_profile, 'name')}`}>
<Button to={`/${encodeURIComponent(get(holder_profile, 'name'))}`}>
{get(holder_profile, 'name')}
</Button>
) : MARKETPLACE_CONTRACTS_TO_NAME[holder_address] ? (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/subjkts-search-results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function SubjktsSearchResults() {
{holders.map(({ user_address, name, metadata }) => (
<div key={name} className={styles.subjkt_result}>
<div className={styles.flex}>
<Link className={styles.user_box} to={encodeURI(`/${name}`)}>
<Link className={styles.user_box} to={encodeURIComponent(`/${name}`)}>
{metadata.data && (
<Identicon
className={styles.subjkt_icon}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/objkt-display/tabs/History.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function UsernameAndLink({ event, attr }) {
<>
{get(event, `${attr}_profile.name`) ? (
<span>
<Button href={`/${encodeURI(get(event, `${attr}_profile.name`))}`}>
<Button href={`/${encodeURIComponent(get(event, `${attr}_profile.name`))}`}>
{get(event, `${attr}_profile.name`)}
</Button>
</span>
Expand Down Expand Up @@ -224,7 +224,7 @@ export const History = () => {
from={<UsernameAndLink event={e} attr="from" />}
to={
<span>
<Button href={`/tz/${encodeURI(BURN_ADDRESS)}`}>
<Button href={`/tz/${encodeURIComponent(BURN_ADDRESS)}`}>
Burn Address
</Button>
</span>
Expand Down
Loading