From 2d11001af884d5e0c5c2e4a62f6097472051e855 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 3 Dec 2019 20:13:29 +0100 Subject: [PATCH] Fix validazione P.IVA --- modules/anagrafiche/validation.php | 2 +- src/Validate.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/anagrafiche/validation.php b/modules/anagrafiche/validation.php index 524777282..9c6755bb8 100644 --- a/modules/anagrafiche/validation.php +++ b/modules/anagrafiche/validation.php @@ -66,7 +66,7 @@ switch ($name) { $errors[] = tr('La partita iva inserita non possiede un formato valido'); } - if (empty($check['valid'])) { + if (isset($check['valid']) && empty($check['valid'])) { $result = false; $errors[] = tr("Impossibile verificare l'origine della partita iva"); } diff --git a/src/Validate.php b/src/Validate.php index 30b379a36..376eb7cf2 100644 --- a/src/Validate.php +++ b/src/Validate.php @@ -54,8 +54,10 @@ class Validate */ public static function isValidVatNumber($vat_number) { + $result['valid-format'] = true; + if (empty($vat_number)) { - $result['valid-format'] = true; + return $result; } // Controllo sulla sintassi