Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] automatically generate safe fallback filename#16656
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh commentedNov 24, 2015
| Q | A |
|---|---|
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #16603 |
| License | MIT |
| Doc PR |
Yannik commentedNov 24, 2015
Hi Christian, Best regards, Yannik |
nicolas-grekas commentedNov 25, 2015
Why couldn't we useRFC 2231? |
xabbuh commentedNov 25, 2015
@nicolas-grekas Encoding a string according to RFC 2231 leads to |
ghost commentedJan 31, 2016
@xabbuh Your PR is awesome! Hopefully this will be merged into Symfony. |
fabpot commentedFeb 29, 2016
@nicolas-grekas@xabbuh Can we find something that works for everyone here? I'd like to merge this one ASAP if possible. |
xabbuh commentedMar 1, 2016
If we removed the limitation of not being able to have the percent character in the fallback filename, we could use RFC 2231 afaics as@nicolas-grekas proposed. But I am not sure why this check was added initially. |
| } | ||
| if ('' ===$filenameFallback && (!preg_match('/^[\x20-\x7e]*$/',$filename) ||false !==strpos($filename,'%'))) { | ||
| $encoding =mb_detect_encoding($filename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
mb_detect_encoding($string, null, true) to enable strict mode (non-strict is useless)
fabpot commentedMar 4, 2016
@xabbuh Do you have time to finish this one? If not, just let me know and I will finish it for you. |
xabbuh commentedMar 4, 2016
@fabpot@nicolas-grekas I pushed an update. |
fabpot commentedMar 4, 2016
👍 |
1 similar comment
nicolas-grekas commentedMar 4, 2016
👍 |
fabpot commentedMar 4, 2016
Thank you@xabbuh. |
…name (xabbuh)This PR was merged into the 2.3 branch.Discussion----------[HttpFoundation] automatically generate safe fallback filename| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#16603| License | MIT| Doc PR |Commits-------03721e3 automatically generate safe fallback filename
Yannik commentedMar 4, 2016
@fabpot Will this be merged into the more current releases of symfony? |
xabbuh commentedMar 4, 2016
@Yannik Yes, we regularly merge lower branches into all higher maintained branches. |