diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index e31e6fd4e..dd945d328 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -418,13 +418,15 @@ SQL; */ public function getFileExtension() { - // TODO : what's the point of having this function? Can we not just use - // the extension from the file_path column from cc_files? $possible_ext = $this->getRealFileExtension(); if ($possible_ext !== "") { return $possible_ext; } + + // We fallback to guessing the extension from the mimetype if we + // cannot extract it from the file name + $mime = $this->_file->getDbMime(); if ($mime == "audio/ogg" || $mime == "application/ogg") {