Skip to content

Commit

Permalink
Merge branch '4.4' into 5.3
Browse files Browse the repository at this point in the history
* 4.4:
  [Mime] Relaxing in-reply-to header validation
  • Loading branch information
derrabus committed Dec 22, 2021
2 parents ea3ea82 + 3526a32 commit 4d4d706
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Mime/Header/Headers.php
Expand Up @@ -34,8 +34,8 @@ final class Headers
'cc' => MailboxListHeader::class,
'bcc' => MailboxListHeader::class,
'message-id' => IdentificationHeader::class,
'in-reply-to' => IdentificationHeader::class,
'references' => IdentificationHeader::class,
'in-reply-to' => UnstructuredHeader::class, // `In-Reply-To` and `References` are less strict than RFC 2822 (3.6.4) to allow users entering the original email's ...
'references' => UnstructuredHeader::class, // ... `Message-ID`, even if that is no valid `msg-id`
'return-path' => PathHeader::class,
];

Expand Down
14 changes: 14 additions & 0 deletions src/Symfony/Component/Mime/Tests/Header/HeadersTest.php
Expand Up @@ -280,6 +280,20 @@ public function testToArray()
], $headers->toArray());
}

public function testInReplyToAcceptsNonIdentifierValues()
{
$headers = new Headers();
$headers->addHeader('In-Reply-To', 'foobar');
$this->assertEquals('foobar', $headers->get('In-Reply-To')->getBody());
}

public function testReferencesAcceptsNonIdentifierValues()
{
$headers = new Headers();
$headers->addHeader('References' , 'foobar');
$this->assertEquals('foobar', $headers->get('References')->getBody());
}

public function testHeaderBody()
{
$headers = new Headers();
Expand Down

0 comments on commit 4d4d706

Please sign in to comment.