Check filesize is greater than zero before deleteing a file from library

This commit is contained in:
drigato 2014-10-27 12:39:02 -04:00
parent 7edd993fa3
commit 7018f45c0a

View file

@ -383,6 +383,9 @@ SQL;
Logging::info("User ".$user->getLogin()." is deleting file: ".$this->_file->getDbTrackTitle()." - file id: ".$file_id);
$filesize = $this->_file->getFileSize();
if ($filesize <= 0) {
throw new Exception("Cannot delete file with filesize ".$filesize);
}
//Delete the physical file from either the local stor directory
//or from the cloud