From d09d9e45bef20ee63ebec755e5a90bc3d4e1fee4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 21 Apr 2007 19:58:24 +0000 Subject: [PATCH] xmlparse now returns -1 when a file is corrupt. Detect this situatioon and notify the user that we are unlinking the file. --- etc/inc/config.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/inc/config.inc b/etc/inc/config.inc index c19a694aca..6bdfc36947 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -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']);