Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Sandbox https://www.drupal.org/sandbox/encelado/1936168 uses the PHP-IBAN library. Which is quite extensive.
My patch is a proposal for a short but valid version.
Comment | File | Size | Author |
---|---|---|---|
#2 | iban_validator-2329137-1.patch | 1.68 KB | rudiedirkx |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
rudiedirkx CreditAttribution: rudiedirkx commentedPatch in #1 is bad. Wrong regex and wrong match check.
Attached patch is good: allow up to 14 numbers.
Comment #3
TR CreditAttribution: TR commentedThe regexp is just plain wrong. You use
Problems are:
If you plan to add something like this, it is almost mandatory that you provide test cases so that the proper functioning can be assured. Regardless, if you're going to do it, please take the time and do the research to get it correct. As it stands, it rejects valid IBAN numbers and allows invalid IBAN numbers, so in some ways it's worse than no validation at all.
Comment #4
rudiedirkx CreditAttribution: rudiedirkx commentedThat's simple then. Don't add it.
We only tried Dutch IBAN, so there was no extensive research. I guess a regex that will validate for all countries is impossible.