Skip to content

Commit d031c0a

Browse files
Merge branch '5.4' into 6.0
* 5.4: (21 commits) Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes #40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share #45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes #41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests [Process] Fix Process::getEnv() when setEnv() hasn't been called before ...
2 parents f7343f9 + 957f6b6 commit d031c0a

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

DelayedEnvelope.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ private static function getSenderFromHeaders(Headers $headers): Address
8686
if ($sender = $headers->get('Sender')) {
8787
return $sender->getAddress();
8888
}
89-
if ($from = $headers->get('From')) {
90-
return $from->getAddresses()[0];
91-
}
9289
if ($return = $headers->get('Return-Path')) {
9390
return $return->getAddress();
9491
}
92+
if ($from = $headers->get('From')) {
93+
return $from->getAddresses()[0];
94+
}
9595

9696
throw new LogicException('Unable to determine the sender of the message.');
9797
}

Tests/EnvelopeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ public function testSenderFromHeadersWithoutFrom()
101101
public function testSenderFromHeadersWithMulitpleHeaders()
102102
{
103103
$headers = new Headers();
104-
$headers->addMailboxListHeader('From', [$from = new Address('[email protected]', 'from'), '[email protected]']);
105-
$headers->addPathHeader('Return-Path', $return = new Address('[email protected]', 'return'));
104+
$headers->addMailboxListHeader('From', [new Address('[email protected]', 'from'), '[email protected]']);
105+
$headers->addPathHeader('Return-Path', new Address('[email protected]', 'return'));
106106
$headers->addMailboxHeader('Sender', $sender = new Address('[email protected]', 'sender'));
107107
$headers->addMailboxListHeader('To', ['[email protected]']);
108108
$e = Envelope::create(new Message($headers));
109109
$this->assertEquals($sender, $e->getSender());
110110

111111
$headers = new Headers();
112-
$headers->addMailboxListHeader('From', [$from = new Address('[email protected]', 'from'), '[email protected]']);
112+
$headers->addMailboxListHeader('From', [new Address('[email protected]', 'from'), '[email protected]']);
113113
$headers->addPathHeader('Return-Path', $return = new Address('[email protected]', 'return'));
114114
$headers->addMailboxListHeader('To', ['[email protected]']);
115115
$e = Envelope::create(new Message($headers));
116-
$this->assertEquals($from, $e->getSender());
116+
$this->assertEquals($return, $e->getSender());
117117
}
118118

119119
public function testRecipientsFromHeaders()

Tests/Transport/NativeTransportFactoryTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Mailer\Tests\Transport;
413

514
use PHPUnit\Framework\TestCase;

Tests/Transport/Smtp/EsmtpTransportFactoryTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Mailer\Tests\Transport\Smtp;
413

514
use Symfony\Component\Mailer\Test\TransportFactoryTestCase;

0 commit comments

Comments
 (0)