CC-2558 : Only delete files from disk that are in stor directory and not scheduled etc.

This commit is contained in:
Naomi Aro 2011-07-18 19:48:20 +02:00
parent b7819211ac
commit c7279f74ca
6 changed files with 87 additions and 66 deletions

View file

@ -341,18 +341,7 @@ class StoredFile {
return PEAR::raiseError('Cannot delete a file that is scheduled in the future.');
}
$storageDir = MusicDir::getStorDir()->getDirectory();
$dirCompare = substr($this->getFilePath(), 0, strlen($storageDir));
//return PEAR::raiseError("({$storageDir} , {$dirCompare})");
// Only delete the file from filesystem if it has been copied to the storage directory
if ($dirCompare === $storageDir) {
return true;
}
else {
return false;
}
return true;
}
/**