1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-03-18 04:00:12 +01:00

fix: gestione errori di XML vuoti o non leggibili

This commit is contained in:
FabioL 2024-12-06 18:03:47 +01:00
parent 94f8cb4657
commit 209be556fd
2 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,10 @@ $filename = get('filename');
$content = file_get_contents($directory.'/'.$filename);
if (empty($content)) {
return;
}
// XML
$xml = new DOMDocument();
$xml->loadXML($content);

View File

@ -36,6 +36,10 @@ class XML
*/
public static function read($string)
{
if (empty($string)) {
return [];
}
$content = $string;
libxml_use_internal_errors(true);