diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-08-24 10:34:16 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-08-24 10:34:16 +0000 |
commit | 8f192f4e81a83d52d46c26d7c78a228474dc4d07 (patch) | |
tree | 54110760b9adf0f9c96b291a61137988e35e74b3 | |
parent | 118476e62930571e40c8d479f2cbea4ea2ea291b (diff) | |
download | pfsense-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.
-rw-r--r-- | etc/inc/xmlparse.inc | 10 |
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]; } |