mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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:
parent
1d5a6e182e
commit
d09d9e45be
@ -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']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user