From 2534135ea693c382e0c8217c5d35d77eb8c9e7e1 Mon Sep 17 00:00:00 2001
From: secretr <m.yovchev@gmail.com>
Date: Thu, 27 Aug 2009 21:50:59 +0000
Subject: [PATCH] xml class - default value key changed to @value; fixes

---
 e107_handlers/xml_class.php | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

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