Skip to content

Commit

Permalink
Update services.yaml and cast time to string
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Valchev committed Nov 20, 2020
1 parent 50bfccc commit 29e7b0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
services:
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
Bolt\BoltForms\EventSubscriber\FileUploadHandler:
arguments:
$projectDir: '%kernel.project_dir%'
2 changes: 1 addition & 1 deletion src/EventSubscriber/FileUploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function uploadFiles(string $filename, $file, string $path = ''): array
Handler::OPTION_OVERWRITE => false,
]);

$uploadHandler->setPrefix(mb_substr(md5(time()), 0, 8) . '_' . $filename);
$uploadHandler->setPrefix(mb_substr(md5((string) time()), 0, 8) . '_' . $filename);

$uploadHandler->setSanitizerCallback(function ($name) {
return $this->sanitiseFilename($name);
Expand Down

0 comments on commit 29e7b0d

Please sign in to comment.