summaryrefslogtreecommitdiffstats
path: root/etc/inc/xmlparse.inc
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-11-26 15:49:08 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-11-26 15:57:55 -0700
commit990d7c037ca44700c30a6cd8bbd877c246944a5d (patch)
tree2f0060a6a3ad2ac94699988657287f706ab2b689 /etc/inc/xmlparse.inc
parentbefad72821f522bf2c23a883f72ade8af48b8533 (diff)
downloadpfsense-990d7c037ca44700c30a6cd8bbd877c246944a5d.zip
pfsense-990d7c037ca44700c30a6cd8bbd877c246944a5d.tar.gz
Check for pfsense root object name in config.xml as a fallback if the configured name is not found.
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