xmlparse now returns -1 when a file is corrupt. Detect this situatioon and notify the user that we are unlinking the file.

This commit is contained in:
Scott Ullrich 2007-04-21 19:58:24 +00:00
parent 1d5a6e182e
commit d09d9e45be

View File

@ -1635,6 +1635,11 @@ function cleanup_backupcache($revisions = 30) {
if($g['booting'])
print " " . $tocheck . "a";
$newxml = parse_xml_config($backup, $g['xml_rootobj']);
if($newxml == "-1") {
unlink($backup);
log_error("The backup cache file $backup is corrupted. Unlinking.");
continue;
}
if($newxml['revision']['description'] == "")
$newxml['revision']['description'] = "Unknown";
$tocache[$tocheck] = array('description' => $newxml['revision']['description']);