EndlesNights / dnd4eBeta

An implementation of the dnd4e game system for Foundry Virtual Tabletop (http://foundryvtt.com).
https://foundryvtt.com/packages/dnd4e
GNU Affero General Public License v3.0
37 stars 30 forks source link

Mixing variables and punctuation can result in invalid data replacements at chat card creation #208

Open BadgerKing7 opened 2 years ago

BadgerKing7 commented 2 years ago

If this sentence The target regains hit points equal to @wisMod or @chaMod. is placed in any power effect detail field, the fullstop marking the end of the sentence is processed as a key delimiter at data replacement in the chat card.

This causes key.split('.') at line 293 in app/common/utils/helpers.mjs in core Foundry to return an array with an emtpy string as the final element which causes p in target at line 295 in the same file to throw an uncaught error.

Since the mix of variables and plain text is made possible by the system's power card, I believe this should be addressed by the system and not left for core Foundry alone. My suggestion would be ignoring trailing fullstops for all variables.

BadgerKing7 commented 2 years ago

The core-side issue can be tracked here.