jsinme / fvtt-bcdice

A FoundryVTT module to query BCDice servers for dice rolls
MIT License
5 stars 3 forks source link

Bug: Some commands escape special characters when sent to API #12

Closed BrotherSharper closed 3 years ago

BrotherSharper commented 3 years ago

What is happening

Using BCDice as system, try inputting 2d6+1>=5 Result: (2D6) > 5[2,3] > 5 Expected result: (2D6+1>=5) > 5[2,3]+1 > 6 > 成功

Cause

In the following code, commands are being sent to the API as-is and are not accounting for character escaping. https://github.com/jsinme/fvtt-bcdice/blob/0.2.2-beta/scripts/bcdice.js#L86

Frequently used characters in BCDice: <>=!@#$[]() etc.

URLSearchParam could help you in fixing this.

jsinme commented 3 years ago

Should be fixed. Will be included in next release. a977c5fe6a3ed763629932577178eeafabd5477b