Skip to content

[Mime] Subject: Double space => missing space #50345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cuchac opened this issue May 16, 2023 · 5 comments · Fixed by #58593
Closed

[Mime] Subject: Double space => missing space #50345

cuchac opened this issue May 16, 2023 · 5 comments · Fixed by #58593

Comments

@cuchac
Copy link
Contributor

cuchac commented May 16, 2023

Symfony version(s) affected

5.4.22

Description

There is an error when generating Subject header containing two spaces. Both spaces got deleted.

From
Balíček k Vaší žádostič.O42300203 právě dorazil
becomes:
Balíček k Vaší žádostič.O42300203právě dorazil

Screenshot_20230516_134350

How to reproduce

> (new \Symfony\Component\Mime\Header\UnstructuredHeader('Subject', 'Balíček k Vaší žádostič.O42300203  právě dorazil'))->toString()
= """
  Subject: =?utf-8?Q?Bal=C3=AD=C4=8Dek?= k\r\n
   =?utf-8?Q?Va=C5=A1=C3=AD_=C5=BE=C3=A1dosti=C4=8D=2EO42300203?= \r\n
   =?utf-8?Q?pr=C3=A1v=C4=9B?= dorazil
  """

Two spaces after O42300203 get lost. Both Gmail and https://dencode.com/en/string/quoted-printable decodes resulting encoded subject header as without any space after O42300203.

Possible Solution

No response

Additional Context

No response

@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@carsonbot
Copy link

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

@xabbuh xabbuh added Keep open and removed Stalled labels Dec 1, 2023
@dosercz
Copy link

dosercz commented Feb 28, 2024

It looks like the same problem with older issue in swiftmailer, but it's still not fixed in Symfony too: swiftmailer/swiftmailer#601

@stof
Copy link
Member

stof commented Feb 28, 2024

based on the closing date, I don't think the issue was ever fixed in Swiftmailer: the issue was closed the day the repo was archived, not because of a fix.

If anyone has a fix for the issue, PRs are welcome.

@dosercz
Copy link

dosercz commented Feb 28, 2024

Yes, it was not fixed and is not fixed there in SF too. But it looks like not so simple to fix it...

fabpot added a commit that referenced this issue Oct 23, 2024
…doubles spaces (0xb4lint)

This PR was submitted for the 7.2 branch but it was squashed and merged into the 5.4 branch instead.

Discussion
----------

[Mime] fix encoding issue with UTF-8 addresses containing doubles spaces

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #58592, Fix #50345
| License       | MIT

Commits
-------

c6ed3c8 [Mime] fix encoding issue with UTF-8 addresses containing doubles spaces
@fabpot fabpot closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants