medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
468 stars 217 forks source link

Strip invisible characters from the fields bsYear, bsMonth, bsDay #9341

Closed binokaryg closed 2 months ago

binokaryg commented 3 months ago

With issue #7654 (PR #7656), we solved the problem of zero-width (invisible) characters ruining the SMS forms.

With #7676 (PR #7718), we made it less strict and allowed the zero-width characters in strings.

With #8447 (PR #8450), we accepted Nepali (Devanagari) numerals in more fields

But it looks like, we missed to strip the invisible characters from some Bikram Sambat date related fields:

https://github.com/medic/cht-core/blob/1b9b6527c77d8668ca4963ddc7a2d5e6aa6b7273/api/src/services/report/smsparser.js#L227-L235

SMS: https://www.fontspace.com/unicode/analyzer#e=TCA5NzI4NyAyMDgxIDEgMeKAjQ

image image

garethbowen commented 2 months ago

@binokaryg Is this something you'd be able to take on?

binokaryg commented 2 months ago

@aloundoye is going to work on it. Please confirm @aloundoye.

aloundoye commented 2 months ago

Hi @garethbowen and @binokaryg, Yes, I am working on it