From 7018f45c0a787ce66686745b24a08e250f97174b Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 27 Oct 2014 12:39:02 -0400 Subject: [PATCH] Check filesize is greater than zero before deleteing a file from library --- airtime_mvc/application/models/StoredFile.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index f035e616d..425a47473 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -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