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:
Ermal Lui 2009-08-24 10:34:16 +00:00
parent 118476e629
commit 8f192f4e81

View File

@ -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];
}