From e7e1926896ab102086085ee7cb19067ba08b2cb4 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Tue, 18 Nov 2014 17:11:09 -0500 Subject: [PATCH] CC-5950: Fix for issue where clear button in Recent Uploads didn't work sometimes --- airtime_mvc/application/models/StoredFile.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 0e588bbe9..8c5910182 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -355,7 +355,13 @@ SQL; { $exists = false; try { - $exists = file_exists($this->getFilePath()); + //Explicitly check filepath because if it's blank, getFilePath() can + //still return a directory that exists. + if (!$this->_file->getDbFilepath()) { + $exists = false; + } else { + $exists = file_exists($this->getFilePath()); + } } catch (Exception $e) { return false; }