Merged
Conversation
Member
|
Looks good, tests good 🚀 |
Contributor
Author
|
Cherry-picked for V15.1 RC |
kjac
added a commit
that referenced
this pull request
Nov 27, 2024
(cherry picked from commit 4590739)
kjac
added a commit
that referenced
this pull request
Nov 27, 2024
This was referenced Nov 28, 2024
This was referenced Sep 28, 2025
This was referenced Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
If there's an existing issue for this PR then this fixes #15939
Description
#15939 describes a difference between how content URL segments and media file names are encoded. However, the issue description is slightly off point - and as it happens, the difference is a feature 😄 albeit a somewhat confusing one, specially when char replacements are added to the mix.
Starting with the latter, with
RequestHandler:EnableDefaultCharReplacementsset totrue(which is the default), specific characters to be replaced with URL friendly alternatives (e.g. "å" is replaced by "aa" in the default configuration). These char replacements apply to both URL segments and file paths.On top of the char replacements we have
RequestHandler:ConvertUrlsToAscii, which is set to"try"by default. This setting only affects the URL segment encoding, and causes all non-ASCII chars to be replaced by an ASCII char.As a result, a content page named "ÅÅ Øø Ææ Ã" will yield the URL segment "aaaa-oeoe-aeae-a", whereas uploading file named "ÅÅ Øø Ææ Ã.png" will yield the media file name "aaaa-oeoe-aeae-ã.png".
At this time there is no way to obtain an ASCII encoded file name, and that is what this PR addresses: It adds the option to configure
RequestHandler:ConvertFileNamesToAsciias the media file name counterpart to content URL segments.The new configuration works the same as
RequestHandler:ConvertUrlsToAscii. It accepts the values"try","true"and"false". To retain the current functionality, the default value forRequestHandler:ConvertFileNamesToAsciiis"false"Future considerations
In reality, we would actually like to have file names ASCII encoded by default. We will likely change the default behaviour of
RequestHandler:ConvertFileNamesToAsciiin an upcoming major release. Keep an eye out for the announcements 😄Testing this PR
Start by testing without adding
RequestHandler:ConvertFileNamesToAsciito app settings. Verify that the current behaviour persists (char conversions are applied to file names but ASCII conversion is not).Add
RequestHandler:ConvertFileNamesToAsciito app settings:"try"and"true"should both yield ASCII conversion."false"should retain the current behaviour (same as not addingRequestHandler:ConvertFileNamesToAsciito app settings).