diff --git a/app/Helpers/StorageHelper.php b/app/Helpers/StorageHelper.php index 47700f913a..3e0e9e2363 100644 --- a/app/Helpers/StorageHelper.php +++ b/app/Helpers/StorageHelper.php @@ -50,15 +50,26 @@ class StorageHelper 'png', ]; - // The file exists and is allowed to be displayed inline if (Storage::exists($file_with_path) && (in_array(pathinfo($file_with_path, PATHINFO_EXTENSION), $allowed_inline))) { return true; } + return false; } + public static function getFiletype($file_with_path) { + + // The file exists and is allowed to be displayed inline + if (Storage::exists($file_with_path)) { + return pathinfo($file_with_path, PATHINFO_EXTENSION); + } + + return null; + + } + /** * Decide whether to show the file inline or download it. */