1
0
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:
SecretR
2013-05-16 13:19:17 +03:00
parent 08149e6710
commit f5a4f06791

View File

@@ -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]))
{