Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
402 stars 186 forks source link

[sf3] Image upload crashes #1183

Closed aistis- closed 8 years ago

aistis- commented 8 years ago

Image upload crashes if filename does not contain extension. For example file my-ribs.jpg will be uploaded successfully, but my-ribsjpg will cause an exception:

[2016-06-02 12:18:34] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined index: extension" at /var/www/html/vendor/kunstmaan/bundles-cms/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php line 175 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ContextErrorException(code: 0): Notice: Undefined index: extension at /var/www/html/vendor/kunstmaan/bundles-cms/src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php:175)"} {"user":{"username":"admin","roles":["ROLE_SUPER_ADMIN","ROLE_PERMISSIONMANAGER","ROLE_ADMIN","IS_AUTHENTICATED_ANONYMOUSLY","ROLE_USER"],"is_account_non_expired":true,"is_account_non_locked":true,"is_credentials_non_expired":true,"is_enabled":true},"file":"/var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php","line":89,"class":"Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener","function":"logException"}

The error occurs on sf3 branch.

jockri commented 8 years ago

Yes, it is not allowed to upload extensionless files. However, the end user should see a nice error message instead of a 500 error.

Numkil commented 8 years ago

@aistis- I can confirm, I tested it myself with a clean project and I am getting the same error messages. I will create a bugfix shortly. Thank you for reporting it.

sandergo90 commented 8 years ago

@jockri close

aistis- commented 8 years ago

Thanks.