Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Mailer][Mime] In some areas header is not treated in a case-insensitive manner #39953

Copy link
Copy link
Closed
@piku235

Description

@piku235
Issue body actions

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@localhost
TypeError(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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.