diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-12-14 09:56:34 -0200 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-12-14 09:56:34 -0200 |
commit | c92ccac76ff2938c5718440efdd846317f6a2d55 (patch) | |
tree | 1dd190505af25191f0289552a155732d7432da58 /etc/inc/xmlparse.inc | |
parent | 386447eaa7cfe727678455955285b1ecd4e6e9f9 (diff) | |
parent | c9b08a50f0ba328ac0569247eb2063d34f7e6279 (diff) | |
download | pfsense-c92ccac76ff2938c5718440efdd846317f6a2d55.zip pfsense-c92ccac76ff2938c5718440efdd846317f6a2d55.tar.gz |
Merge remote branch 'mainline/master' into inc
Conflicts:
etc/inc/auth.inc
etc/inc/config.lib.inc
etc/inc/filter.inc
etc/inc/gwlb.inc
etc/inc/interfaces.inc
etc/inc/pfsense-utils.inc
etc/inc/pkg-utils.inc
etc/inc/shaper.inc
etc/inc/upgrade_config.inc
etc/inc/xmlparse.inc
usr/local/www/fbegin.inc
Diffstat (limited to 'etc/inc/xmlparse.inc')
-rw-r--r-- | etc/inc/xmlparse.inc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc index 1738370..c1ab5cd 100644 --- a/etc/inc/xmlparse.inc +++ b/etc/inc/xmlparse.inc @@ -179,20 +179,27 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") { while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { - log_error(sprintf(gettext('XML error: %1$s at line %2$d') . "\n", + log_error(sprintf(gettext('XML error: %1$s at line %2$d in %3$s') . "\n", xml_error_string(xml_get_error_code($xml_parser)), - xml_get_current_line_number($xml_parser))); + xml_get_current_line_number($xml_parser), + $cffile)); return -1; } } xml_parser_free($xml_parser); - if (!$parsedcfg[$rootobj]) { + if (!is_array($rootobj)) + $rootobj = array($rootobj); + foreach ($rootobj as $rootobj_name) + if ($parsedcfg[$rootobj_name]) + break; + + if (!$parsedcfg[$rootobj_name]) { log_error(sprintf(gettext("XML error: no %s object found!") . "\n", $rootobj)); return -1; } - return $parsedcfg[$rootobj]; + return $parsedcfg[$rootobj_name]; } function dump_xml_config_sub($arr, $indent) { |