From d8a53e00b4e3232c7cb3bf8038464d40d7c341b2 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Sat, 9 Apr 2016 17:07:15 +0200 Subject: [PATCH] Check if given country is in Europe, bail early otherwise. --- src/Validator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Validator.php b/src/Validator.php index d1a2332098..780c645a5f 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -73,6 +73,10 @@ public function check( $vatNumber, $countryCode = '' ) { $vatNumber = substr( $vatNumber, 2 ); } + // check if country is in EU, bail early otherwise. + if( ! $this->isEuCountry( $countryCode ) ) { + return false; + } try { $response = $this->client->checkVat( array(