mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Test if we actually succeeded in opening the requested xml file and log an error in bad cases to avoid strange errors.
This commit is contained in:
parent
118476e629
commit
8f192f4e81
@ -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];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user