Fixed #17674 - added odp, ods, odt to accepted files

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-08-20 14:11:20 +01:00
parent 312be98132
commit 618106c103
6 changed files with 38 additions and 5 deletions
+12 -1
View File
@@ -29,7 +29,7 @@ class StorageHelper
public static function getMediaType($file_with_path) {
// The file exists and is allowed to be displayed inline
// Get the file extension and determine the media type
if (Storage::exists($file_with_path)) {
$fileinfo = pathinfo($file_with_path);
$extension = strtolower($fileinfo['extension']);
@@ -51,6 +51,15 @@ class StorageHelper
case 'webm':
case 'mov':
return 'video';
case 'doc':
case 'docx':
return 'document';
case 'txt':
return 'text';
case 'xls':
case 'xlsx':
case 'ods':
return 'spreadsheet';
default:
return $extension; // Default for unknown types
}
@@ -87,9 +96,11 @@ class StorageHelper
'webp',
];
\Log::error(pathinfo($file_with_path, PATHINFO_EXTENSION));
// 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))) {
\Log::error('File is allowed inline: ' . $file_with_path);
return true;
}
return false;