8000 [Validator] Some countries are missing · Issue #58126 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Some countries are missing #58126

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
tugrul opened this issue Aug 30, 2024 · 1 comment
Closed

[Validator] Some countries are missing #58126

tugrul opened this issue Aug 30, 2024 · 1 comment

Comments

@tugrul
Copy link
tugrul commented Aug 30, 2024

Symfony version(s) affected

6.4.10

Description

Some countries are not included and IbanValidator warns.

How to reproduce

Try to submit this iban MN140005005163847716.

<?php
namespace App\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;

class IbanValidatorFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('iban', TextType::class, [
                'label' => 'iban',
                'constraints' => [
                    new Assert\Iban()
                ],
                'attr' => [
                    'placeholder' => 'enter_your_iban_here'
                ]
            ])
            ->add('submit', SubmitType::class, [
                'label' => 'validate'
            ])
        ;
    }
}

Possible Solution

I see there is an update script Resources/bin/sync-iban-formats.php. The list will possibly updated when the script executed.

Additional Context

No response

@tugrul tugrul added the Bug label Aug 30, 2024
nicolas-grekas added a commit that referenced this issue Aug 30, 2024
This PR was merged into the 5.4 branch.

Discussion
----------

[Validator] synchronize IBAN formats

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #58126
| License       | MIT

Commits
-------

7af5182 synchronize IBAN formats
@tugrul
Copy link
Author
tugrul commented Aug 31, 2024

I think this country's IBAN code features have changed later.

-        'NI' => 'NI\d{2}[A-Z]{4}\d{24}', // Nicaragua
+        'NI' => 'NI\d{2}[A-Z]{4}\d{20}', // Nicaragua

nicolas-grekas added a commit that referenced this issue Feb 19, 2025
This PR was merged into the 6.4 branch.

Discussion
----------

[Validator] Synchronize IBAN formats

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | #58126 (comment)
| License       | MIT

Estonia and São Tomé and Principe are simplified as returned by www.swift.com, while Nicaragua is fixed.

Commits
-------

5c2ebfb [Validator] Synchronize IBAN formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0