From b090355ef3de6f22dc63a3816a4d17570ce29541 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 26 Feb 2026 08:42:52 +0100 Subject: [PATCH] UBL21: check invalid PEPPOL ID --- include/XMLDocument/invoiceubl21.class.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php index b4098626e..ee4f1cd0e 100644 --- a/include/XMLDocument/invoiceubl21.class.php +++ b/include/XMLDocument/invoiceubl21.class.php @@ -162,18 +162,10 @@ class InvoiceUBL21 extends XMLInvoice { $a_error[]=$value; } } - if ( $this->data['customer']["endpoint_id"] != "") + // check if peppol id has the form 9999:9999... + if (preg_match('/[0-9]+:[[:alnum:]]+/',$this->data['customer']["endpoint_id"]) == 0) { - // check if peppol id has the form 9999:9999... - list($scheme_id,$peppol)=explode(":", $this->data['customer'][$value]); - if (preg_replace('/[0-9]/', '', $scheme_id) != "") - { $a_error[]='endpoint_id'; - }elseif(\noalyss_trim($peppol) =="") - { - $a_error[]='endpoint_id'; - - } } if ( $this->data['customer']["customer_vat_id"] != "" && preg_match('/[a-z]{2}/i',$this->data['customer']["customer_vat_id"] ) == false) {