This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony
Fabien Potencier 43eb050c0d bug #39970 [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #33913
| License       | MIT
| Doc PR        | -

Replaces #33920

When using the Doctrine transport, sending emails with binary attachments currently requires a custom Messenger serializer because the "body" column is created for UTF-8 only.

In #33920, it is proposed to change the TEXT type to a BLOB. It leaves at least one problem unhandled: the conversion of existing messenger tables.

This PR takes a more conservative approach, by encoding messages to base 64, only if they are non-UTF8.

Compatibility with the existing format is preserved.

The drawback of this approach is that the size of eg email attachments is going to increase by 33% because of the extra encoding. I think this drawback is acceptable for 4.4, and that this PR is the most pragmatic way to make attachments just work.

Commits
-------

6fc9e51722 [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64
2021-01-25 22:43:21 +01:00
..
Bridge Changed private static array-properties to const 2021-01-25 00:44:26 +01:00
Bundle add doctrine/persistence as a dev requirement 2021-01-25 17:45:18 +01:00
Component [Messenger] Fix transporting non-UTF8 payloads by encoding them using base 64 2021-01-25 18:37:49 +01:00
Contracts minor #39779 Contracts: Remove ellipsis (alexislefebvre) 2021-01-12 12:27:16 +01:00