Skip to content

[Validator] Fix Costa Rica IBAN format #24900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

[Validator] Fix Costa Rica IBAN format #24900

wants to merge 2 commits into from

Conversation

Warxcell
Copy link
Contributor

Q A
Branch? 2.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets no
License MIT
Doc PR no

Fix Costa Rica IBAN format: https://bank.codes/iban/structure/costa-rica/

@@ -57,7 +57,7 @@ class IbanValidator extends ConstraintValidator
'CH' => 'CH\d{2}\d{5}[\dA-Z]{12}', // Switzerland
'CI' => 'CI\d{2}[A-Z]{1}\d{23}', // Ivory Coast
'CM' => 'CM\d{2}\d{23}', // Cameron
'CR' => 'CR\d{2}\d{3}\d{14}', // Costa Rica
'CR' => 'CR\d{2}0\d{3}\d{14}', // Costa Rica
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is security related, thus needs to be changed on lower branches. I'd prefer the BC variant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepting an invalid IBAN is a bug. There's no BC to preserve here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.. this wont lead to crashing behavior. My bad 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://bank.codes/iban/structure/costa-rica/ implies it can be any kind of number btw... not sure in practice it's always 0.

Copy link
Contributor Author

@Warxcell Warxcell Nov 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ro0NL https://www.iban.com/calculate-iban.html - this site does not give you ability to choose Reserve Number. It automatically set it 0.

Also wiki says:

CRkk 0bbb cccc cccc cccc cc

0= always zero
b = bank code
c = Account number

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ro0NL Ok I leave it like that and point it to 2.7

@xabbuh xabbuh added this to the 2.7 milestone Nov 10, 2017
@Warxcell Warxcell changed the base branch from 2.8 to 2.7 November 10, 2017 12:53
@Warxcell Warxcell changed the base branch from 2.7 to 2.8 November 10, 2017 12:54
@Warxcell Warxcell changed the base branch from 2.8 to 2.7 November 10, 2017 13:08
@fabpot
Copy link
Member

fabpot commented Nov 10, 2017

Thank you @Warxcell.

fabpot added a commit that referenced this pull request Nov 10, 2017
This PR was squashed before being merged into the 2.7 branch (closes #24900).

Discussion
----------

[Validator] Fix Costa Rica IBAN format

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | no
| License       | MIT
| Doc PR        | no

Fix Costa Rica IBAN format: https://bank.codes/iban/structure/costa-rica/

Commits
-------

b9b5e18 [Validator] Fix Costa Rica IBAN format
@fabpot fabpot closed this Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants