taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 396eb369894874c8b52a0a52ef3bba5c94577b18
parent cad5e6434b498c2bf2b4d51d338e358860855040
Author: Florian Dold <florian@dold.me>
Date:   Sat, 18 Jul 2026 11:54:00 +0200

util: do length checks in IBAN after whitespace stripping

Diffstat:
Mpackages/taler-util/src/iban.ts | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/taler-util/src/iban.ts b/packages/taler-util/src/iban.ts @@ -181,14 +181,14 @@ export function convertCHF_BBANtoIBAN( export function parseIban( ibanString: string, ): Result<IbanString, ParseIbanError> { - if (ibanString.length < 4) { + const myIban = ibanString.toUpperCase().replace(/[\s-\._]/g, ""); + if (myIban.length < 4) { return Result.error(ParseIbanError.TOO_SHORT); } - if (ibanString.length > 34) { + if (myIban.length > 34) { return Result.error(ParseIbanError.TOO_LONG); } - const myIban = ibanString.toUpperCase().replace(/[\s-\._]/g, ""); const countryCode = myIban.substring(0, 2); const countryInfo = ibanCountryInfoTable[countryCode];