Details
-
Bug
-
Resolution: Fixed
-
High
-
1.6.0
-
None
Description
If you try to download a file with non ASCII characters – wontÆØÅwork.svg – you will get a 500 Internal Server Error.
By checking the logs, you will find this:
request.CRITICAL:
Uncaught PHP Exception InvalidArgumentException: "The filename fallback must only contain ASCII characters." at /var/www/ez-001/2016/app/bootstrap.php.cache line 1998{"exception":"[object] ( InvalidArgumentException(code: 0): The filename fallback must only contain ASCII characters. at /var/www/ez-001/2016/app/bootstrap.php.cache:1998 )"}
The error seems to come from the ResponseHeaderBag.php file:
Symfony/Component/HttpFoundation/ResponseHeaderBag.php
* @param string $filenameFallback A string containing only ASCII characters that * is semantically equivalent to $filename. If the filename is already ASCII, * it can be omitted, or just copied from $filename public function makeDisposition($disposition, $filename, $filenameFallback = '') { ... // filenameFallback is not ASCII. if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); }
I'm not sure why the name wasn't normalized.
Steps to reproduce.
- Choose any file and rename it to wontÆØÅwork.ext
- Open the admin interface, create a new file and upload wontÆØÅwork.ext
- Open that content object with the wontÆØÅwork.ext in the frontend, and try to download it.
Attachments
Issue Links
- relates to
-
EZP-27944 Fatal error when trying to download files named with non-ASCII characters using BinaryStreamResponse
- Closed