NilsEnevoldsen / ScryfallLinks

MediaWiki extension that creates Scryfall links from Magic: The Gathering card names
MIT License
7 stars 3 forks source link

Links with nonnumeric collector numbers are broken until javascript/API fixes them #69

Open NilsEnevoldsen opened 1 month ago

NilsEnevoldsen commented 1 month ago

Input

<c set="ALL" number="88B">Elvish Ranger</c>

Link produced by Hooks.php before API is accessed (before mouseover)

Actual: https://scryfall.com/search?q=%21%22Elvish+Ranger%22+set%3AALL+cn%3A88B&amp;utm_source=mw_MTGWiki (i.e. https://scryfall.com/search?q=!"Elvish+Ranger"+set:ALL+cn:88B&utm_source=mw_MTGWiki)

Expected: https://scryfall.com/search?q=%21%22Elvish+Ranger%22+set%3AALL+cn%3A%2288B%22&amp;utm_source=mw_MTGWiki (i.e. https://scryfall.com/search?q=!"Elvish+Ranger"+set:ALL+cn:"88B"&utm_source=mw_MTGWiki)

Link produced after API is accessed (after mouseover)

Actual/Expected: https://scryfall.com/card/all/88b/elvish-ranger?utm_source=mw_MTGWiki

Solution

Update this to have quotation marks: https://github.com/NilsEnevoldsen/ScryfallLinks/blob/0906ec6fb88f0fdf72224270a6f5c5cf09e00b54/src/Hooks.php#L225