1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

xml class - default value key changed to @value; fixes

This commit is contained in:
secretr
2009-08-27 21:50:59 +00:00
parent 22fcfd85e8
commit 2534135ea6

View File

@@ -9,8 +9,8 @@
* Simple XML Parser * Simple XML Parser
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $
* $Revision: 1.15 $ * $Revision: 1.16 $
* $Date: 2009-08-27 14:34:20 $ * $Date: 2009-08-27 21:50:59 $
* $Author: secretr $ * $Author: secretr $
*/ */
@@ -119,7 +119,7 @@ class xmlClass
* @see setOptValueKey() * @see setOptValueKey()
* @var string * @var string
*/ */
protected $_optValueKey = 'value'; protected $_optValueKey = '@value';
/** /**
* Constructor - set defaults * Constructor - set defaults
@@ -145,7 +145,7 @@ class xmlClass
$this->filter = false; $this->filter = false;
$this->stripComments = true; $this->stripComments = true;
$this->_optAddRoot = false; $this->_optAddRoot = false;
$this->_optValueKey = 'value'; $this->_optValueKey = '@value';
$this->_optForceArray = false; $this->_optForceArray = false;
return $this; return $this;
} }
@@ -348,6 +348,12 @@ class xmlClass
{ {
//$ret = $this->xml2array($xml, true); //$ret = $this->xml2array($xml, true);
//repeating code because of the _optForceArray functionality //repeating code because of the _optForceArray functionality
if(!is_object($xml))
{
return array();
}
$tags = array_keys($tags); $tags = array_keys($tags);
foreach ($tags as $tag) foreach ($tags as $tag)
{ {