summaryrefslogtreecommitdiffstats
path: root/etc/inc/xmlparse.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-08-24 10:34:16 +0000
committerErmal Luçi <eri@pfsense.org>2009-08-24 10:34:16 +0000
commit8f192f4e81a83d52d46c26d7c78a228474dc4d07 (patch)
tree54110760b9adf0f9c96b291a61137988e35e74b3 /etc/inc/xmlparse.inc
parent118476e62930571e40c8d479f2cbea4ea2ea291b (diff)
downloadpfsense-8f192f4e81a83d52d46c26d7c78a228474dc4d07.zip
pfsense-8f192f4e81a83d52d46c26d7c78a228474dc4d07.tar.gz
Test if we actually succeeded in opening the requested xml file and log an error in bad cases to avoid strange errors.
Diffstat (limited to 'etc/inc/xmlparse.inc')
-rw-r--r--etc/inc/xmlparse.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc
index eacd528..78178b8 100644
--- a/etc/inc/xmlparse.inc
+++ b/etc/inc/xmlparse.inc
@@ -119,11 +119,11 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") {
$parsedcfg = array();
$par = new XMLReader();
- $par->open($cffile);
-
- add_elements($parsedcfg, $par);
-
- $par->close();
+ if ($par->open($cffile)) {
+ add_elements($parsedcfg, $par);
+ $par->close();
+ } else
+ log_error("Error returned while trying to parse {$cffile}");
return $parsedcfg[$rootobj];
}
OpenPOWER on IntegriCloud