Fixed #8719 - use same convention for file names on licenses as we do on assets

This commit is contained in:
snipe 2020-11-12 15:13:45 -08:00
parent f0e04ab9e4
commit 57d25ebb20

View file

@ -39,7 +39,8 @@ class LicenseFilesController extends Controller
$upload_success = false;
foreach ($request->file('file') as $file) {
$file_name = 'license-'.date('Y-m-d-His').'-'.$file->getBasename().'.'.$file->getClientOriginalExtension();
$file_name = 'license-'.$license->id.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$file->getClientOriginalExtension())).'.'.$file->getClientOriginalExtension();
$upload_success = $file->storeAs('private_uploads/licenses', $file_name);