Use core file sanitization

Created on 31 August 2023, over 1 year ago
Updated 13 March 2024, 9 months ago

Problem/Motivation

Provide options to sanitize filenames (transliterate, lowercase, replace whitespace, etc) Fixed landed. We currently sanitize in the UploadHandler, using code borrowed from the same issue. Transliteration is configurable (no FE IIRC), other options are hardcoded.

Steps to reproduce

Proposed resolution

To unify sanitization behavior, dispatch the FileUploadSanitizeNameEvent event in UploadHandler.

Remaining tasks

Open questions:

  1. Should we enable transliteration in a post_update hook depending on what value filename_transliteration was set to in dropzonejs.settings?
  2. Should we remove that variable?
  3. In \Drupal\dropzonejs\Element\DropzoneJs::valueCallback the event gets dispatched already. This was done as part of #3277296: Drupal 10 compatibility, require Drupal 9.3 . I don't see a reason to keep that, but I might be overlooking something.

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇸🇮Slovenia primsi

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024