8000 bug #23619 [Validator] Fix IbanValidator for ukrainian IBANs (paroe) · symfony/symfony@ee58cfc · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee58cfc

Browse files
committed
bug #23619 [Validator] Fix IbanValidator for ukrainian IBANs (paroe)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #23619). Discussion ---------- [Validator] Fix IbanValidator for ukrainian IBANs The ukrainian bank identifier consists of six digits and not letters. Also fixes the broken links to the current SWIFT IBAN registry pdf. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 1ba9573 [Validator] Fix IbanValidator for ukrainian IBANs
2 parents da6ed16 + 1ba9573 commit ee58cfc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Symfony/Component/Validator/Constraints/IbanValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class IbanValidator extends ConstraintValidator
3434
* a BBAN (Basic Bank Account Number) which has a fixed length per country and,
3535
* included within it, a bank identifier with a fixed position and a fixed length per country
3636
*
37-
* @see http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf
37+
* @see https://www.swift.com/sites/default/files/resources/iban_registry.pdf
3838
*
3939
* @var array
4040
*/
@@ -130,7 +130,7 @@ class IbanValidator extends ConstraintValidator
130130
'TL' => 'TL\d{2}\d{3}\d{14}\d{2}', // Timor-Leste
131131
'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia
132132
'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey
133-
'UA' => 'UA\d{2}[A-Z]{6}[\dA-Z]{19}', // Ukraine
133+
'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine
134134
'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British
135135
'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands
136136
'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo

src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function getValidIbans()
118118

119119
//Extended country list
120120
//http://www.nordea.com/Our+services/International+products+and+services/Cash+Management/IBAN+countries/908462.html
121-
// http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf
121+
// https://www.swift.com/sites/default/files/resources/iban_registry.pdf
122122
array('AO06000600000100037131174'), //Angola
123123
array('AZ21NABZ00000000137010001944'), //Azerbaijan
124124
array('BH29BMAG1299123456BH00'), //Bahrain
@@ -156,6 +156,7 @@ public function getValidIbans()
156156
array('TL380080012345678910157'), //Timor-Leste
157157
array('TN5914207207100707129648'), //Tunisia
158158
array('TR330006100519786457841326'), //Turkey
159+
array('UA213223130000026007233566001'), //Ukraine
159160
array('AE260211000000230064016'), //United Arab Emirates
160161
);
161162
}
@@ -268,6 +269,7 @@ public function getIbansWithInvalidFormat()
268269
array('TL3800800123456789101571'), //Timor-Leste
269270
array('TN59142072071007071296481'), //Tunisia
270271
array('TR3300061005197864578413261'), //Turkey
272+
array('UA21AAAA1300000260072335660012'), //Ukraine
271273
array('AE2602110000002300640161'), //United Arab Emirates
272274
);
273275
}
@@ -377,6 +379,7 @@ public function getIbansWithValidFormatButIncorrectChecksum()
377379
array('TL380080012345678910158'), //Timor-Leste
378380
array('TN5914207207100707129649'), //Tunisia
379381
array('TR330006100519786457841327'), //Turkey
382+
array('UA213223130000026007233566002'), //Ukraine
380383
array('AE260211000000230064017'), //United Arab Emirates
381384
);
382385
}

0 commit comments

Comments
 (0)
0