[PATCH] Add datas of section in an array instead in a variable separated with <br />
David Durieux
d.durieux at siprossii.com
Sat Aug 21 15:36:52 UTC 2010
---
Classes/Action/InventoryAction.class.php | 9 +++------
Classes/FusionLibServer.class.php | 2 +-
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Classes/Action/InventoryAction.class.php b/Classes/Action/InventoryAction.class.php
index a2c88b0..92dc61e 100644
--- a/Classes/Action/InventoryAction.class.php
+++ b/Classes/Action/InventoryAction.class.php
@@ -161,19 +161,16 @@ class InventoryAction extends Action
DataFilter::filter($section);
}
-
- ob_start();
+ $sectionData = array();
foreach ($section->children() as $data)
{
- echo $data->getName()." = ".$data."<br />";
+ $sectionData[$data->getName()] = (string)$data;
}
- $sectionData = ob_get_contents();
- ob_end_clean();
//sectionId initialization, we will affect id after hook createSection return value.
array_push($xmlSections, (array(
"sectionId" => 0,
- "sectionHash" => md5($sectionData),
+ "sectionHash" => md5(extract($sectionData)),
"sectionName" => $section->getName(),
"sectionData" => $sectionData)));
}
diff --git a/Classes/FusionLibServer.class.php b/Classes/FusionLibServer.class.php
index e7ddb6e..1db02e6 100644
--- a/Classes/FusionLibServer.class.php
+++ b/Classes/FusionLibServer.class.php
@@ -81,7 +81,7 @@ class FusionLibServer
public function start()
{
- $simpleXMLObj = simplexml_load_string(@gzuncompress($GLOBALS["HTTP_RAW_POST_DATA"]));
+ $simpleXMLObj = simplexml_load_string(@gzuncompress($GLOBALS["HTTP_RAW_POST_DATA"],'SimpleXMLElement', LIBXML_NOCDATA));
//$simpleXMLObj = simplexml_load_file(dirname(__FILE__) ."/../data/aofr.ocs");
$log = new Logger();
--
1.7.1
--MP_/G7y9L.XJdlxWsKW0mDBx.+p--
More information about the Fusioninventory-devel
mailing list