Skip to content

A free open source IT asset/license management system

Added method to decide if the file should be inlinable

snipe96191a5e9391
diff --git a/app/Helpers/StorageHelper.php b/app/Helpers/StorageHelper.php
index 2cdab1d66c..0b56aa97cd 100644
--- a/app/Helpers/StorageHelper.php
+++ b/app/Helpers/StorageHelper.php
@@ -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;
+
+ }
}