jschaedl / iban-validation

:bank: A small library for validating International Bank Account Numbers (IBANs)
MIT License
88 stars 19 forks source link

bcmod(): bcmath function argument is not well-formed in PHP 7.4 #22

Closed bigwhoop closed 4 years ago

bigwhoop commented 4 years ago

Hi,

PHP 7.4 no longer suppresses malformed input for bcmath functions. See https://www.php.net/manual/en/migration74.incompatible.php

If you try to validate the IBAN MCBKCWCU25727002 for example, the library will use BK as part of the checksum and make the call bcmod('12321230257270022212BK', '97', 0) in \Iban\Validation\Validator::local_bcmod. As you can see the first argument is not numeric and it leads to the error mentioned in the title.

bigwhoop commented 4 years ago

Hi. Could you please release a new version that includes this fix? Thanks

jschaedl commented 4 years ago

@bigwhoop Here you go: https://github.com/jschaedl/iban-validation/releases/tag/v1.5