Skip to content

fix: accept 7-digit CIFs in company/add endpoint - #1119

Merged
ale23yfm merged 1 commit into
masterfrom
fix/cif-7digit-validation
Jul 27, 2026
Merged

fix: accept 7-digit CIFs in company/add endpoint#1119
ale23yfm merged 1 commit into
masterfrom
fix/cif-7digit-validation

Conversation

@sebiboga

Copy link
Copy Markdown
Member

Fix

Changes isValidCif() regex from /^\d{8}$/ to /^\d{2,10}$/ to accept Romanian CIFs of any valid length (2-10 digits). Older companies can have CIFs as short as 4 digits.

Also updated the error message accordingly.

Changes

  • v1/firme/company/add/index.php line 51: regex /^\d{8}$/ -> /^\d{2,10}$/
  • v1/firme/company/add/index.php line 97: error message updated

Closes #1118

Romanian CIFs can be fewer than 8 digits (e.g. 4, 7). Changed regex from
/^\d{8}$/ to /^\d{2,10}$/ in isValidCif() and updated the error message
accordingly.

Closes #1118
@ale23yfm
ale23yfm merged commit 870a7a9 into master Jul 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: CIF validation rejects 7-digit CIFs in company/add endpoint

2 participants