mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Better handling of empty values (XML handler)
This commit is contained in:
@@ -560,7 +560,16 @@ class xmlClass
|
||||
|
||||
//more cases?
|
||||
default:
|
||||
|
||||
// fix - empty SimpleXMLElement
|
||||
if(empty($xml->{$tag}))
|
||||
{
|
||||
if($this->arrayTags && in_array($tag, $this->arrayTags))
|
||||
{
|
||||
$ret[$tag] = array();
|
||||
}
|
||||
else $ret[$tag] = '';
|
||||
break;
|
||||
}
|
||||
$count = count($xml->{$tag});
|
||||
if($count >= 1) //array of elements - loop
|
||||
{
|
||||
@@ -704,7 +713,6 @@ class xmlClass
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if(isset($vars[$vl]) && is_array($vars[$vl]) && !varset($vars[$vl][0]))
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user