Use the new core FileUploadSanitizeNameEvent for sanitizing

Created on 16 February 2022, about 3 years ago
Updated 27 February 2024, about 1 year ago

Problem/Motivation

Currently, sanitizing filenames is hardcoded in the UploadHandler, implemented in #2828845: Make filename transliteration consistent with upcoming core issue as a temporary solution until Provide options to sanitize filenames (transliterate, lowercase, replace whitespace, etc) Fixed landed in core. Which it has in 8.7 ( change record ).

Steps to reproduce

Upload a file, make sure filename_transliteration is enabled in config (by default it is, no UI). See #2846920: Make filename transliteration optional .

Proposed resolution

Use the new FileUploadSanitizeNameEvent which is also used by SecurityFileUploadEventSubscriber in core for preventing insecure filenames.

Modules like transliterate_filenames now also use this event for translitarion.

Remaining tasks

Discuss whether the filename_transliteration should remain optional, especially when the remaining issues of Provide options to sanitize filenames (transliterate, lowercase, replace whitespace, etc) Fixed land (like a user interface for this in core).

User interface changes

None.

API changes

Dropzone will trigger the FileUploadSanitizeNameEvent event during upload.

Data model changes

None.

Feature request
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇳🇱Netherlands askibinski

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024