node-steamcommunity icon indicating copy to clipboard operation
node-steamcommunity copied to clipboard

marketSearch breaks on weirdly named items

Open yaneony opened this issue 7 years ago • 2 comments

As already reported on Discord, there are some strange named items on the market, for example this one: https://steamcommunity.com/market/listings/570/Autograph%3A%20p%DA%29r

It seems, this one contains some weird character and "decodeURIComponent" can't handle this one.

An error occurs here, on this line https://github.com/DoctorMcKay/node-steamcommunity/blob/master/classes/CMarketSearchResult.js#L85

Message:

URIError: URI malformed
    at decodeURIComponent (<anonymous>)

yaneony avatar Apr 10 '18 05:04 yaneony

Wrapping line 68 in try/catch works fine.

        try {
          results.push(new CMarketSearchResult($(rows[i])));
        } catch (error) {

        }

yaneony avatar Apr 13 '18 20:04 yaneony

As already reported on Discord, there are some strange named items on the market, for example this one: https://steamcommunity.com/market/listings/570/Autograph%3A%20p%DA%29r

It seems, this one contains some weird character and "decodeURIComponent" can't handle this one.

An error occurs here, on this line https://github.com/DoctorMcKay/node-steamcommunity/blob/master/classes/CMarketSearchResult.js#L85

Message:

URIError: URI malformed
    at decodeURIComponent (<anonymous>)

Market link you've provided seems to be broken as well there is no such item called "Autograph: p�)r" problem could be from somewhere else.

Preport avatar Jul 21 '20 09:07 Preport