mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Added method to decide if the file should be inlinable
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c56affd663
commit
96191a5e93
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue