Skip to content

Commit

Permalink
fix: properly escape special characters in profile name links (#433)
Browse files Browse the repository at this point in the history
* fix: properly escape special characters in profile name links
  • Loading branch information
Zir0h authored Nov 20, 2024
1 parent b043b4f commit b850938
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit b850938

Please sign in to comment.