Current code uses the following snippet to create the filename for the ICS file.
$filename = 'event-' . strtolower(Html::cleanCssIdentifier($field_settings['title'])) . '.ics';
Html::cleanCssIdentifier though doesn't transliterate the $field_settings['title'] value.
As a result, if the title contains unicode characters, the following exception is thrown: InvalidArgumentException: The filename fallback must only contain ASCII characters.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | ascii_only_characters_expected_in_ics_files_title-3175373-6.patch | 4.07 KB | vensires |
Comments
Comment #2
vensiresComment #3
vensiresComment #4
zekvyrin commentedI'm ok with the change, but these need to come from dependency injection, not using Drupal:: global.
Comment #5
vensiresYou 're right! Patch attached with some further cleanup.
Comment #6
vensiresFixed a small bug in the previous patch.
Comment #7
zekvyrin commentedWhy did you remove entityTypeManager?
It's used in line 107 (pre-patch)
I see currentUser wasn't used, so it can be removed, although I had the intention of adding it to tokens. But I guess this is a another todo.
Comment #8
zekvyrin commentedoh I see.. entityTypeManager() is a function in controllerBase. I need to test that (soon hopefully)
Comment #9
vensirescurrentUser() is also provided by ControllerBase ;)
Comment #11
zekvyrin commentedCommited. Thank you @vensires
Comment #12
zekvyrin commented