A free open source IT asset/license management system
Added fieldname to file name for better clarity on setting logos
snipea86dc5269580
diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.phpindex 39b61be45a..2b43f9194d 100644--- a/app/Http/Requests/ImageUploadRequest.php+++ b/app/Http/Requests/ImageUploadRequest.php@@ -86,9 +86,10 @@ class ImageUploadRequest extends Request$image = $this->file($form_fieldname);$ext = $image->getClientOriginalExtension();- $file_name = $type.'-'.str_random(18).'.'.$ext;+ $file_name = $type.'-'.$form_fieldname.'-'.str_random(10).'.'.$ext;\Log::info('File name will be: '.$file_name);+ \Log::debug('File extension is: '. $ext);if ($image->getClientOriginalExtension()!=='svg') {\Log::debug('Not an SVG - resize');@@ -101,6 +102,7 @@ class ImageUploadRequest extends Request// This requires a string instead of an object, so we use ($string)Storage::disk('public')->put($path.'/'.$file_name, (string)$upload->encode());+// If the file is an SVG, we need to clean it and NOT encode it} else {\Log::debug('This is an SVG');