-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Closed
Copy link
Description
Symfony version(s) affected: 5.2
Description
Recently, I've had a problem with a capitalized header when I tried to define a global sender in the framework config. The issue happens in the Headers::addHeader() when trying to resolve a header class from the header class map.
Also, Headers::isUniqueHeader() is affected and header rules in the MessageListener::addHeaderRule().
The feature pull request for reference.
How to reproduce
The following config leads to an exception in Headers::addHeader()
framework:
mailer:
headers:
From: foo@localhostTypeError(code: 0): Argument 2 passed to Symfony\\Component\\Mime\\Header\\Headers::addTextHeader() must be of the type string, array given
Possible Solution
The fix is simple, we need to ensure that strtolower() is used when doing something specific on a user-supplied header name.