From 4fcacdfc035c13139ba13a0cccab7cad9cd06acf Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 19 Dec 2025 15:45:39 +0100 Subject: [PATCH] protect note et remove unwanted space in PEPPOLID --- include/XMLDocument/invoiceubl21.class.php | 4 ++-- include/XMLDocument/xmlinvoice.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php index dca7c1a00..33259119d 100644 --- a/include/XMLDocument/invoiceubl21.class.php +++ b/include/XMLDocument/invoiceubl21.class.php @@ -196,7 +196,7 @@ class InvoiceUBL21 extends XMLInvoice { $customer=$this->createElement('cac:AccountingCustomerParty'); $customer_party=$customer->appendChild($this->createElement('cac:Party')); - list($scheme_id,$peppol)=explode( ":",$this->data['customer']['endpoint_id']); + list($scheme_id,$peppol)=explode( ":",trim($this->data['customer']['endpoint_id'])); $customer_party->appendChild($this->createElement('cbc:EndpointID',$peppol)) ->setAttribute('schemeID', $scheme_id); @@ -277,7 +277,7 @@ class InvoiceUBL21 extends XMLInvoice { $supplier=$this->createElement('cac:AccountingSupplierParty'); $supplier_party=$supplier->appendChild($this->createElement('cac:Party')); - list($scheme_id,$peppol)=explode( ":",$company['COMPANY_PEPPOL_ID']); + list($scheme_id,$peppol)=explode( ":",trim($company['COMPANY_PEPPOL_ID'])); $supplier_party->appendChild($this->createElement('cbc:EndpointID',$peppol)) ->setAttribute('schemeID', $scheme_id); diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php index 8c87f4687..9bfe5d10c 100644 --- a/include/XMLDocument/xmlinvoice.class.php +++ b/include/XMLDocument/xmlinvoice.class.php @@ -194,7 +194,7 @@ abstract class XMLInvoice extends \DOMDocument for ($e=0;$e<$nb_note;$e++) { - $result['note'].= html_entity_decode($a_note[$e]['n_text']); + $result['note'].= html_entity_decode($a_note[$e]['n_text']??""); } // goods and services $result['operation']=array();