DragonBe / vies

Component using the European Commission (EC) VAT Information Exchange System (VIES) to verify and validate VAT registration numbers in the EU, using PHP and Composer.
http://ec.europa.eu/taxation_customs/vies/faqvies.do#item16
MIT License
266 stars 59 forks source link

Italian validator assumes numeric input #67

Closed willemstuursma closed 5 years ago

willemstuursma commented 5 years ago

We got a nice error:

Stack trace:
#0 vendor/dragonbe/vies/src/Vies/Validator/ValidatorIT.php(52): {closure}(2, 'A non-numeric v...', '/data/www/...', 52, Array)
#1 vendor/dragonbe/vies/src/Vies/Vies.php(305): DragonBe\Vies\Validator\ValidatorIT->validate('AA123456789')
#2 vendor/dragonbe/vies/src/Vies/Vies.php(242): DragonBe\Vies\Vies->validateVatSum('IT', 'AA123456789')
#3 application/classes/supplier/vies.php(72): DragonBe\Vies\Vies->validateVat('IT', 'AA123456789', '..', '...')

Note that the number was invalid to start with, but a ctype_digit check would have prevented an error from being triggered. It tries to do some math calculation on a non-digit.

willemstuursma commented 5 years ago

Same with the ValidatorHR class.

DragonBe commented 5 years ago

Hi @willemstuursma, my apologies for my delayed response.

I was able to fix the reported in PR #68 and have release 2.1.7 ready for you to use. Please update your composer package.

willemstuursma commented 5 years ago

Hi @willemstuursma, my apologies for my delayed response.

No problem! Thank you for resolving!