backup MDL-22251 fixed issue with delete_old_backup_dirs passing a full path rather than a backupid

This commit is contained in:
Sam Hemelryk
2010-04-30 03:02:36 +00:00
parent 16b5fdaf17
commit 2589eb89f0
+3 -2
View File
@@ -59,7 +59,7 @@ abstract class backup_helper {
return rmdir($CFG->dataroot . '/temp/backup/' . $backupid);
}
/**
/**
* Given one fullpath to directory, delete its contents recursively
* Copied originally from somewhere in the net.
* TODO: Modernise this
@@ -137,7 +137,8 @@ abstract class backup_helper {
if ($status && $moddate < $deletefrom) {
//If directory, recurse
if (is_dir($file_path)) {
$status = self::delete_backup_dir($file_path);
// $file is really the backupid
$status = self::delete_backup_dir($file);
//If file
} else {
unlink($file_path);