Skip to content

Commit

Permalink
Merge branch '5.0' into 5.1
Browse files Browse the repository at this point in the history
* 5.0:
  Allow email message to have "To", "Cc", or "Bcc" header to be valid
  [FrameworkBundle] Removed detection of Serializer < 3.2
  Update pull request template for 5.1.
  [Security/Core] fix PHP8 deprecation
  • Loading branch information
nicolas-grekas committed May 25, 2020
2 parents caeebd0 + c7fb653 commit 56261f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public function toIterable(): iterable

public function ensureValidity()
{
if (!$this->headers->has('To')) {
throw new LogicException('An email must have a "To" header.');
if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) {
throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
}

if (!$this->headers->has('From') && !$this->headers->has('Sender')) {
Expand Down

0 comments on commit 56261f8

Please sign in to comment.