CC-2558 : Only delete files from disk that are in stor directory and not scheduled etc.
This commit is contained in:
parent
b7819211ac
commit
c7279f74ca
6 changed files with 87 additions and 66 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue