Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

CIF validation error #3

Open
Open
@Azariil

Description

@Azariil

Hi.
When I use the validator to test this CIF - J2854880H (this CIF is generated by this service: http://generadordni.es/), the validator returns false. But all the CIF verification services tell me. that this is correct CIF (for example this service: https://comunidadhorizontal.com/utiles/validar-cif-nif-nie/).
In the isValidCIFFormat function, if the first character "J" is present in the CIF, all other characters must be a digit.

respectsDocPattern(
                $docNumber,
                '/^[ABCDEFGHJUV][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/' );

Although. if I understand correctly, then the content and letters in the last character are allowed as in this line:

return
            respectsDocPattern(
                $docNumber,
                '/^[PQSNWR][0-9][0-9][0-9][0-9][0-9][0-9][0-9][A-Z0-9]/' )

And now I can not understand CIF J2854880H valid or not?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions