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:
parent
94f8cb4657
commit
209be556fd
@ -26,6 +26,10 @@ $filename = get('filename');
|
||||
|
||||
$content = file_get_contents($directory.'/'.$filename);
|
||||
|
||||
if (empty($content)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// XML
|
||||
$xml = new DOMDocument();
|
||||
$xml->loadXML($content);
|
||||
|
@ -36,6 +36,10 @@ class XML
|
||||
*/
|
||||
public static function read($string)
|
||||
{
|
||||
if (empty($string)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$content = $string;
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user