diff --git a/src/components/layout/CardTooltip/CardTooltip.tsx b/src/components/layout/CardTooltip/CardTooltip.tsx index 5c23820bc1..f32beee28b 100644 --- a/src/components/layout/CardTooltip/CardTooltip.tsx +++ b/src/components/layout/CardTooltip/CardTooltip.tsx @@ -7,7 +7,7 @@ type Props = { }; const CardTooltip = ({ cardName, children }: Props) => { - const url = cardName ? `https://api.scryfall.com/cards/named?format=image&version=normal&exact=${cardName}` : ""; + const url = cardName ? `https://api.scryfall.com/cards/named?format=image&version=normal&exact=${encodeURIComponent(cardName)}` : ""; const divRef = useRef(null); diff --git a/src/pages/combo/[id]/index.tsx b/src/pages/combo/[id]/index.tsx index b3c173ce68..2947afa0a9 100644 --- a/src/pages/combo/[id]/index.tsx +++ b/src/pages/combo/[id]/index.tsx @@ -41,8 +41,8 @@ const Combo = ({ combo, alternatives }: Props) => { const cards = combo.uses.map((card) => { return { name: card.card.name, - artUrl: `https://api.scryfall.com/cards/named?format=image&version=art_crop&exact=${card.card.name}`, - oracleImageUrl: `https://api.scryfall.com/cards/named?format=image&version=normal&exact=${card.card.name}`, + artUrl: `https://api.scryfall.com/cards/named?format=image&version=art_crop&exact=${encodeURIComponent(card.card.name)}`, + oracleImageUrl: `https://api.scryfall.com/cards/named?format=image&version=normal&exact=${encodeURIComponent(card.card.name)}`, }; }); const cardNames = combo.uses.map(card => card.card.name);