Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
BSN 0 and 00000000 validate as valid, but are invalid BSN numbers.
Comment | File | Size | Author |
---|---|---|---|
#5 | bsnvalidation-2888780-4.patch | 768 bytes | askibinski |
Comments
Comment #2
JoshaHubbers CreditAttribution: JoshaHubbers at ezCompany commentedempty validates 0 as valid. Isset will do.
Comment #3
paulvandenburg CreditAttribution: paulvandenburg at ezCompany commentedAdded a minor improvement to the validation, but functionally it was good.
Comment #4
askibinski CreditAttribution: askibinski as a volunteer and at ezCompany commentedThe empty function was used to handle usecases when the BSN field is not required. However, in this case it would indeed result in '0' returning a valid BSN number because 0 returns true in empty(). The !isset() does not fix this because it never triggers (it is always set even if empty).
The check needs to be different in case the field is left empty.
Comment #5
askibinski CreditAttribution: askibinski as a volunteer and at ezCompany commentedComment #6
paulvandenburg CreditAttribution: paulvandenburg at ezCompany commentedTested a non required empty bsn field which works again with the patch.
0 and 00000000 are still caught as invalid.
Comment #8
ralphvdhoudt CreditAttribution: ralphvdhoudt at ezCompany commentedComment #9
ralphvdhoudt CreditAttribution: ralphvdhoudt at ezCompany commented