commit 9394309efeb0e8db55a3050bd289502872497980
parent 8d384a38f99054d23ddd7295b6914b5d4e3d3efe
Author: Florian Dold <florian@dold.me>
Date: Sat, 18 Jul 2026 16:14:53 +0200
iban validation fixes
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/taler-util/src/iban.ts b/packages/taler-util/src/iban.ts
@@ -240,7 +240,7 @@ export function validateIban(ibanString: string): IbanValidationResult {
};
}
- const myIban = ibanString.toLocaleUpperCase().replace(" ", "");
+ const myIban = ibanString.toLocaleUpperCase().replace(/\s/g, "");
const countryCode = myIban.substring(0, 2);
const countryInfo = ibanCountryInfoTable[countryCode];
@@ -264,7 +264,7 @@ export function validateIban(ibanString: string): IbanValidationResult {
}
for (let i = 0; i < 4; i++) {
- if (!appendDigit(digits, ibanString.charCodeAt(i))) {
+ if (!appendDigit(digits, myIban.charCodeAt(i))) {
return {
type: "invalid",
code: ParseIbanError.INVALID_CHARSET,