From a3ec855338879b00667e6e824d82943ec7158069 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Thu, 27 Jul 2023 08:52:57 +0200 Subject: [PATCH] =?UTF-8?q?[27/07/2023]=20On=20ajoute=20les=20n=C2=B0=20de?= =?UTF-8?q?=20TVA=20de=20Chypre=20dans=20la=20RegEx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventListeners/CustomerVatNumberEventListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local/modules/CustomerVatNumber/EventListeners/CustomerVatNumberEventListener.php b/local/modules/CustomerVatNumber/EventListeners/CustomerVatNumberEventListener.php index 622cf78b..6f3d8a33 100755 --- a/local/modules/CustomerVatNumber/EventListeners/CustomerVatNumberEventListener.php +++ b/local/modules/CustomerVatNumber/EventListeners/CustomerVatNumberEventListener.php @@ -100,7 +100,7 @@ class CustomerVatNumberEventListener implements EventSubscriberInterface public function checkVatNumber($value, ExecutionContextInterface $context) { // @see https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s21.html - static $vatNumberRegexp = "/^((AT)?U[0-9]{8}|(BE)?0[0-9]{9}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}L|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}L|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{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