-
-
Notifications
You must be signed in to change notification settings - Fork 531
Description
Bug report
Summary
Enabling upload_translit and setting friendly_alias_max_length can break filenames upon upload
Step to reproduce
In system settings, enable upload_translit and set friendly_alias_max_length. Upload for example jpg file with filename length exceeding friendly_alias_max_length chars.
Observed behavior
Uploaded filename including extension is after transliteration trimmed to friendly_alias_max_length chars, thus losing its extension. While in some configurations file type is derived from file content itself and not from file extension, a lot of functionality is broken. For example, trying to delete such file leads to error saying that '' is not allowed file type. Also third party components are affected, like MoreGallery.
This results from modMediaSource calling xpdo->filterPathSegment() on uploaded filename.
Expected behavior
In the first place, FURL setting like friendly_alias_max_length should not be used for uploaded file names (there can be a separate setting). But the main point is that transliterating and trimming filenames should keep extensions intact, affecting only filename itself.