Added method to decide if the file should be inlinable

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-10-17 00:07:54 +01:00
parent c56affd663
commit 96191a5e93

View file

@ -25,4 +25,25 @@ class StorageHelper
return Storage::disk($disk)->download($filename);
}
}
public static function allowSafeInline($file_with_path) {
$allowed_inline = [
'pdf',
'svg',
'jpg',
'gif',
'svg',
'avif',
'webp',
'png',
];
if (in_array(pathinfo($file_with_path, PATHINFO_EXTENSION), $allowed_inline)) {
return true;
}
return false;
}
}