diff --git a/Constraints/IbanValidator.php b/Constraints/IbanValidator.php index 423e0099d..5581fdb7c 100644 --- a/Constraints/IbanValidator.php +++ b/Constraints/IbanValidator.php @@ -73,6 +73,7 @@ class IbanValidator extends ConstraintValidator 'EG' => 'EG\d{2}\d{4}\d{4}\d{17}', // Egypt 'ES' => 'ES\d{2}\d{4}\d{4}\d{1}\d{1}\d{10}', // Spain 'FI' => 'FI\d{2}\d{3}\d{11}', // Finland + 'FK' => 'FK\d{2}[A-Z]{2}\d{12}', // Falkland Islands 'FO' => 'FO\d{2}\d{4}\d{9}\d{1}', // Faroe Islands 'FR' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'GA' => 'GA\d{2}\d{23}', // Gabon @@ -117,6 +118,7 @@ class IbanValidator extends ConstraintValidator 'MG' => 'MG\d{2}\d{23}', // Madagascar 'MK' => 'MK\d{2}\d{3}[\dA-Z]{10}\d{2}', // Macedonia 'ML' => 'ML\d{2}[\dA-Z]{2}\d{22}', // Mali + 'MN' => 'MN\d{2}\d{4}\d{12}', // Mongolia 'MQ' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'MR' => 'MR\d{2}\d{5}\d{5}\d{11}\d{2}', // Mauritania 'MT' => 'MT\d{2}[A-Z]{4}\d{5}[\dA-Z]{18}', // Malta @@ -127,6 +129,7 @@ class IbanValidator extends ConstraintValidator 'NI' => 'NI\d{2}[A-Z]{4}\d{24}', // Nicaragua 'NL' => 'NL\d{2}[A-Z]{4}\d{10}', // Netherlands (The) 'NO' => 'NO\d{2}\d{4}\d{6}\d{1}', // Norway + 'OM' => 'OM\d{2}\d{3}[\dA-Z]{16}', // Oman 'PF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'PK' => 'PK\d{2}[A-Z]{4}[\dA-Z]{16}', // Pakistan 'PL' => 'PL\d{2}\d{8}\d{16}', // Poland @@ -160,6 +163,7 @@ class IbanValidator extends ConstraintValidator 'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands 'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France 'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Kosovo + 'YE' => 'YE\d{2}[A-Z]{4}\d{4}[\dA-Z]{18}', // Yemen 'YT' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France ]; diff --git a/Resources/bin/sync-iban-formats.php b/Resources/bin/sync-iban-formats.php index fa7ba520c..6f2a9b049 100755 --- a/Resources/bin/sync-iban-formats.php +++ b/Resources/bin/sync-iban-formats.php @@ -168,7 +168,7 @@ public function getIbanFormats(): array $formats = []; foreach ($this->readIbanFormatsTable() as $item) { - if (!preg_match('/^([A-Z]{2})/', $item['Example'], $matches)) { + if (!preg_match('/^([A-Z]{2})/', $item['IBAN Fields'], $matches)) { continue; } diff --git a/Tests/Constraints/IbanValidatorTest.php b/Tests/Constraints/IbanValidatorTest.php index eb625fa49..becc24f51 100644 --- a/Tests/Constraints/IbanValidatorTest.php +++ b/Tests/Constraints/IbanValidatorTest.php @@ -86,6 +86,7 @@ public static function getValidIbans() ['CZ65 0800 0000 1920 0014 5399'], // Czech Republic ['DK50 0040 0440 1162 43'], // Denmark ['EE38 2200 2210 2014 5685'], // Estonia + ['FK12 SC98 7654 3210 98'], // Falkland Islands ['FO97 5432 0388 8999 44'], // Faroe Islands ['FI21 1234 5600 0007 85'], // Finland ['FR14 2004 1010 0505 0001 3M02 606'], // France @@ -109,9 +110,11 @@ public static function getValidIbans() ['MU17 BOMM 0101 1010 3030 0200 000M UR'], // Mauritius ['MD24 AG00 0225 1000 1310 4168'], // Moldova ['MC93 2005 2222 1001 1223 3M44 555'], // Monaco + ['MN14 0005 0051 6384 7716'], // Mongolia ['ME25 5050 0001 2345 6789 51'], // Montenegro ['NL39 RABO 0300 0652 64'], // Netherlands ['NO93 8601 1117 947'], // Norway + ['OM04 0280 0000 1234 5678 901'], // Oman ['PK36 SCBL 0000 0011 2345 6702'], // Pakistan ['PL60 1020 1026 0000 0422 7020 1111'], // Poland ['PT50 0002 0123 1234 5678 9015 4'], // Portugal @@ -128,6 +131,7 @@ public static function getValidIbans() ['TR33 0006 1005 1978 6457 8413 26'], // Turkey ['AE07 0331 2345 6789 0123 456'], // UAE ['GB12 CPBK 0892 9965 0449 91'], // United Kingdom + ['YE09 CBKU 0000 0000 0000 1234 5601 01'], // Yemen ['DJ21 0001 0000 0001 5400 0100 186'], // Djibouti ['EG38 0019 0005 0000 0000 2631 8000 2'], // Egypt