From 85f081f2863590df9f300cf036e5bd363d7b17bf Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Fri, 22 Feb 2019 19:25:28 +0100 Subject: [PATCH] idk --- StorageBundle/Storage.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/StorageBundle/Storage.php b/StorageBundle/Storage.php index d3a9b89..30e8215 100644 --- a/StorageBundle/Storage.php +++ b/StorageBundle/Storage.php @@ -123,8 +123,10 @@ class Storage $camel = ucfirst(Container::camelize($attribute)); if ($file instanceof UploadedFile) { - $file_hash .= strlen($file->getExtension()) ? '.'.$file->getExtension() : ''; - if (!is_null($storage_annotation->mime)) { + $file_hash .= strlen($file->getClientOriginalExtension()) > 0 ? '.'.$file->getClientOriginalExtension() : ''; + + if (!is_null($storage_annotation->mime)) + { $valid = true; if (count(explode('/', $storage_annotation->mime)) > 1) { $valid = strtolower($storage_annotation->mime) == $file->getMimeType();