From ffa81f82d00e48c0e171ce42a528ef4d08d7e179 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Mon, 28 Feb 2022 12:09:24 +0100 Subject: [PATCH] Fix importazione FE con codice articolo vuoto --- src/Util/XML.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Util/XML.php b/src/Util/XML.php index e2cedf753..5599ebde3 100755 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -48,6 +48,12 @@ class XML throw new Exception($message); } + $xpath = '//*[not(normalize-space())]'; + + foreach (array_reverse($xml->xpath($xpath)) as $remove) { + unset($remove[0]); + } + $result = json_decode(json_encode($xml), true); return $result;