- 🇦🇪United Arab Emirates mkhamash Dubai
I have switched the above patch to use the built-in event FileUploadSanitizeNameEvent this will allow other modules like transliterate_filenames to dispatch on the event.
Reference code was: https://api.drupal.org/api/drupal/core%21modules%21file%21src%21Plugin%2...
- 🇫🇷France nicolas bouteille
This looks promising, but I have applied your patch and installed transliterate_filenames and it does not sanitize the filename :/
What I am missing? - Merge request !8Issue #3118456: Possibility to sanitize file name when using CORS? → (Merged) created by mkhamash
- Status changed to Needs review
over 1 year ago 12:46pm 22 February 2023 - 🇦🇪United Arab Emirates mkhamash Dubai
Sorry Nicolas, yes I missed the part where I use the sanitized file [$event->getFilename()] fixed the patch and created a PR.
- 🇪🇪Estonia hkirsman
Last patch flysystem_s3-sanitize-file-name-with-cors-3118456-10.patch works well with what probably will be a core feature soon https://www.drupal.org/project/drupal/issues/2492171 ✨ Provide options to sanitize filenames (transliterate, lowercase, replace whitespace, etc) Fixed on Drupal 9.5.5.
Thanks!
- Status changed to Needs work
about 1 year ago 11:30am 18 October 2023 - 🇬🇧United Kingdom Eli-T Manchester
Merge request needs rebasing manually: https://git.drupalcode.org/project/flysystem_s3/-/merge_requests/8
- Status changed to Needs review
12 months ago 2:55pm 11 December 2023 - 🇦🇪United Arab Emirates mkhamash Dubai
Rebased the PR and added a new patch file against
2.0.x-2d930c9fc4092f37944285ecf09659eaa1c9a062
- Status changed to Needs work
12 months ago 6:21pm 11 December 2023 - 🇬🇧United Kingdom Eli-T Manchester
Thanks for the rebase @mkhamash!
It looks like this introduces new phpcs issues that we would need to resolve.
There are phpstan warnings too but it doesn't look like they were introduced by this patch, I guess the default Gitlab CI is doing more now than when it was first introduced.
Can I ask why you uploaded a patch as well as updating the MR? I'm not sure that's necessary.
-
Eli-T →
committed 027fcb75 on 2.0.x authored by
mkhamash →
Issue #3118456: Possibility to sanitize file name when using CORS?
-
Eli-T →
committed 027fcb75 on 2.0.x authored by
mkhamash →
- Status changed to Fixed
11 months ago 12:49pm 18 December 2023 - 🇬🇧United Kingdom Eli-T Manchester
Tidied up, tested, and merged!
Thanks everyone - looks like this should work with the core functionality in 10.2.x automatically, as soon as we have a version of flysystem that supports it.
Automatically closed - issue fixed for 2 weeks with no activity.