Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Fix exception: The filename fallback must only contain ASCII characters. #28551

Conversation

Projects
None yet
5 participants
@4n70w4
Copy link
Contributor

commented May 16, 2019

Generate and pass $filenameFallback param to \Symfony\Component\HttpFoundation\HeaderUtils::makeDisposition().

Problem: downloading files with Cyrillic names does not work. Test complete.
\Illuminate\Tests\Filesystem\FilesystemAdapterTest::testDownloadNonAsciiFilename()

@4n70w4 4n70w4 force-pushed the SymfonyRotEbal:fix_the_filename_fallback_must_only_contain_ascii_characters branch from e1c0d63 to b50fc20 May 16, 2019

@driesvints driesvints changed the title fix exception: The filename fallback must only contain ASCII characters. [5.8] Fix exception: The filename fallback must only contain ASCII characters. May 16, 2019

@4n70w4

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2019

@driesvints thanks, I improved the test!

@4n70w4

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2019

Related: #2703 #2305 #28369

@taylorotwell

This comment has been minimized.

Copy link
Member

commented May 16, 2019

$name defaults to null. So you are passing Str::ascii(null) potentially? I feel like we aren't thinking this issue through every time we get an issue or PR about it.

@4n70w4

This comment has been minimized.

Copy link
Contributor Author

commented May 16, 2019

@taylorotwell thank you, I did not think about it. I fix it!

@@ -138,7 +138,8 @@ public function response($path, $name = null, array $headers = [], $disposition
{
$response = new StreamedResponse;
$disposition = $response->headers->makeDisposition($disposition, $name ?? basename($path));
$target_name = $name ?? basename($path);

This comment has been minimized.

Copy link
@fragkp

fragkp May 16, 2019

Contributor

$target_name camelCase 😃

This comment has been minimized.

Copy link
@4n70w4

4n70w4 May 17, 2019

Author Contributor

@fragkp continuous-integration/styleci/pr says that everything is ok. camelCase is this private requirement?

This comment has been minimized.

Copy link
@fragkp

fragkp May 17, 2019

Contributor

I'm wondering why stylci is not failing. camelCase is the default for variable names in laravel. You could check this in all other files.

This comment has been minimized.

Copy link
@GrahamCampbell

GrahamCampbell May 17, 2019

Member

StyleCI cannot fail for those cases, because it is not possible to fix such cases without breaking dynamic code. There are also various special cases where snake case is needed.

This comment has been minimized.

Copy link
@4n70w4

4n70w4 May 17, 2019

Author Contributor

Okay, I fixed it.
But need to fix the automatic codestyle verification.
External developers don't know your local codestyle rules.

This comment has been minimized.

Copy link
@GrahamCampbell

GrahamCampbell May 17, 2019

Member

But need to fix the automatic codestyle verification.

As I said, it is not broken. It is inherently not possible to safely rename variables.

@taylorotwell taylorotwell merged commit 4fe69b4 into laravel:5.8 May 17, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.