summaryrefslogtreecommitdiffstats
path: root/etc/inc/xmlparse.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/xmlparse.inc')
-rw-r--r--etc/inc/xmlparse.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc
index 582f9b4..9f44e21 100644
--- a/etc/inc/xmlparse.inc
+++ b/etc/inc/xmlparse.inc
@@ -187,12 +187,18 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") {
}
xml_parser_free($xml_parser);
- if (!$parsedcfg[$rootobj]) {
- log_error("XML error: no $rootobj object found!\n");
+ if (!is_array($rootobj))
+ $rootobj = array($rootobj);
+ foreach ($rootobj as $rootobj_name)
+ if ($parsedcfg[$rootobj_name])
+ break;
+
+ if (!$parsedcfg[$rootobj_name]) {
+ log_error("XML error: no $rootobj_name object found!\n");
return -1;
}
- return $parsedcfg[$rootobj];
+ return $parsedcfg[$rootobj_name];
}
function dump_xml_config_sub($arr, $indent) {
OpenPOWER on IntegriCloud