Skip to content

Commit

Permalink
Merge pull request #229 from xPaw/patch-1
Browse files Browse the repository at this point in the history
Fix `market_hash_name` being double encoded in `getCurrentPriceHistory`
  • Loading branch information
Nuklon authored Sep 25, 2024
2 parents 184fd21 + 909b19f commit d711121
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@

// Get the item name id from a market item.
SteamMarket.prototype.getCurrentMarketItemNameId = function(appid, market_name, callback) {
const url = `${window.location.origin}/market/listings/${appid}/${market_name}`;
const url = `${window.location.origin}/market/listings/${appid}/${escapeURI(market_name)}`;

const options = { method: 'GET' };

Expand Down Expand Up @@ -993,19 +993,19 @@
}

if (item.description != null && item.description.market_hash_name != null) {
return escapeURI(item.description.market_hash_name);
return item.description.market_hash_name;
}

if (item.description != null && item.description.name != null) {
return escapeURI(item.description.name);
return item.description.name;
}

if (item.market_hash_name != null) {
return escapeURI(item.market_hash_name);
return item.market_hash_name;
}

if (item.name != null) {
return escapeURI(item.name);
return item.name;
}

return null;
Expand Down

0 comments on commit d711121

Please sign in to comment.