steam-market-api-v2 icon indicating copy to clipboard operation
steam-market-api-v2 copied to clipboard

Incorrect handling of '&' inside Steam URL

Open tomniekerken opened this issue 1 year ago • 1 comments

Hi there,

I noticed inside the file ItemListings.php with the path /src/Requests/Steam/ItemListings.php the constant URL contains regular & symbols.

Because of the current notation, the output of getUrl() and other methods will be https://steamcommunity.com/market/listings/730/AK-47%20%7C%20Redline%20%28Field-Tested%29/render/?query=&start=0&count=1&country=US&language=english¤cy=1&filter= with focus on the last part language=english¤cy=1.

The original &currency will turn into ¤cy.

To fix this problem, you can use various ways looking at following post on Stackoverflow https://stackoverflow.com/questions/41335786/php-curren-string-turns-into-weird-symbol.

The way I fixed it, is using the HTML character entity &, which can be placed just fine inside the URL: https://steamcommunity.com/market/listings/%s/%s/render/?query=%s&start=%s&count=%s&country=%s&language=%s&currency=%s&filter=%s.

I hope this helps! Kind regards

tomniekerken avatar Jun 16 '23 20:06 tomniekerken

Hello,

Thank you for your report. This is the first time I've seen such a problem in two years of the library's work.

Сan you tell me what version of php you are using and at what point this error occurred? How can i reproduce this error? Because on response in field url it shows me the correct query with & symbols.

Allyans3 avatar Jun 27 '23 15:06 Allyans3