payload
payload copied to clipboard
fix(plugin-cloud-storage): encode filename to remove unsupported chars
Description
I've used an encodeURIComponent to encode incoming filename from DB that is broken when unsupported characters are included in string.
This fixes #6985
- [ ] I have read and understand the CONTRIBUTING.md document in this repository.
Type of change
- [ ] Chore (non-breaking change which does not add functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Change to the templates directory (does not affect core functionality)
- [ ] Change to the examples directory (does not affect core functionality)
- [ ] This change requires a documentation update
Checklist:
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
At first glance, I think this would be a breaking change with images that have spaces in them. We'd need to make this safely backwards-compatible.
Correct me if I'm wrong, but I believe the filename args for each adapter are all generated here. If that's the case, a backwards-compatible solution would be to expose a config field for sanitize-filename options.
That would also solve this issue for local uploads, and would enable nested filepaths which currently don't work.