DoctorMcKay / node-steamcommunity

Interact with various interfaces on Steam Community from Node.js
https://dev.doctormckay.com/forum/8-node-steamcommunity/
MIT License
474 stars 127 forks source link

marketSearch breaks on weirdly named items #198

Open yaneony opened 6 years ago

yaneony commented 6 years ago

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 commented 6 years ago

Wrapping line 68 in try/catch works fine.

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

        }
Preport commented 4 years ago

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.